SANDEEP KUMAR

1 About me

I am an APT faculty in the Department of Computer Science and Engineering at Texas A&M University, College Station. That's me on the right as imagined by my daughter when she was 9. I joined the department in August 2022. I have a Bachelor's in Electrical Engineering from the Indian Institute of Technology, New Delhi and a Ph.D. in Computer Science from Purdue University. My thesis advisor at Purdue was the inimitable Gene Spafford. I've run into many in academia and industry who've wanted to talk to me just because Spaf was my advisor, and I was a CERIAS-derivative. It was often great fun confirming or denying various quirks of Spaf.

We have a lot of faculty from Purdue and UIUC here at the TAMU College of Engineering. Other than the extreme winter cold, I loved every bit of life at Purdue.

I've spent a lifetime in the industry and just prior to joining TAMU, I was at VMware in Palo Alto, CA in their networking & security business unit. Ten years in the Bay area spoiled us in many ways, and one of them was the weather! In July 2022 when we drove to College Station with highs in the mid-eighties, little did we realize what the relentless heat of \(110^{\circ}\)F would feel like. Needless to say, we practically vaporized and only partially condensed between October and April. The 2023 summer seemed to be hotter still!

My office is in Peterson 105 and my phone # there is 979-458-6816. You can send me e-mail at sandeep.kumar@tamu.edu.

2 Teaching

In Fall 2023 I'm teaching 12 sections of CSCE 313 (Introduction to Computer Systems) and the Canvas page for the class is here. I'm enjoying revisiting many of the ideas in the class after \(\approx 30\) years, and sometimes it has served to remind me how little many things have changed.

Earlier, in Spring 2023, I taught CSCE 222 (Discrete Math), and in Fall 2022 I taught CSCE 111 (Java Programming) to non-CS majors. I used Kenneth Rosen's Discrete Math and its Applications for CSCE 222 and converted the entire set of slides available in Powerpoint from McGraw Hill into LaTeX beamer. If you use that textbook in your class and need access to the LaTeX slides, I may be able to gather them. Even though I converted the slides into a different format, McGraw Hill still owns the copyright to the slides.

3 A Note for Students

3.1 Foreign Students

I receive many e-mails, particularly from foreign students asking about teaching and research assistantships available with me or within the department. Some even request that I recommend them for such positions. The decision to award any kind of financial assistance is generally made through a committee, but sometimes faculty members agree to fund incoming Ph.D. students if they find great synergy between their research interests and the background of the student. I have no way to affect either outcome, and I also don't have a basis to determine if one incoming student is better than another. The department already factors in a lot of considerations when making a decision, so please do not ask if I can make a special recommendation for you—no matter how good I believe your credentials are.

I'm not a tenure-track faculty, so I primarily teach and don't do research in the department. I don't have external funding so I can't sponsor students for their Ph.D. through my own funding. I can be a member on your thesis committee, but probably not your main advisor.

3.2 Local TAMU Students

I've gotten a lot of email this semester (Fall 2023) from students who want to be teaching assistants or graders for CSCE222, the class I'm teaching in Spring 2024. So let me make a clarification.

TA positions tend to be scarce because the department prefers their own Ph.D. students as TAs over others, and it seems that our Ph.D. student enrollment has also grown of late. It only makes sense to support our own students first. So, the sure shot way to get financial assistance is to enroll in the Ph.D. program!

Many have also asked me to write a recommendation for them for a TA position. I am not aware that a recommendation is needed for a TA position, nor do I have either a “basis” or the “inclination” for making a blind recommendation for anyone. If you are a TAMU student, then you should go to PETR 102 and ask the receptionist for how to get on the list of prospective TAs and graders. There's a method to the madness! Writing directly to me will not help. The department tries to carefully match the prospective list with their teaching needs each semester, and getting on the list is the first step to getting some sort of financial assistance through the department.

3.3 High Schoolers from the neighboring area

I appreciate the fact that many of you want to do independent study projects with TAMU faculty members both to further your knowledge and skills in your areas of interest, and also in the hope of making your college applications more competitive. Unfortunately, I mostly teach for nine months in a year and bail out for the remaining three. The teaching load keeps me fully occupied during the regular semester. So I don't directly take on any student projects but there are likely to be other faculty members in CS who are more organized in this regard. But I'd say this—don't just say that you'd like to work on any available project; rather present a more focused view of your interests and say a few words about how you've worked on similar things in the past and how they align with the specific area(s) that you want to pursue now.

4 Various Tidbits relating to TAMU

4.1 Dr. Radia Perlman as Hagler Fellow
In the Fall 2023 semester (Aug-Dec), we're lucky to have Dr. Radia Perlman as a Hagler fellow at the university. She'll be teaching a class with Charlie Kaufman, another well established name in Computer Security. Radia is a great educator and writer, and you may not want to miss this opportunity to take her class. Back in the mid-nineties, we were briefly together at Sun Labs where we had other distinguished people in the group such as Whit Diffie and Susan Landau. Those were heady days!
4.2 Using Google AppEngine for classes
I've spent some bit of effort off-and-on building Google AppEngine apps for my classes that allow me to do in-class voting, give a problem at the start of the class, have students attempt it, and have their answers appear on my console. AppEngine standard does not allow websockets, so student responses don't update asynchronously in my console, but I've found that not to be too much trouble—only a few students respond anyway!

Unlike Google forms which I used previously, I can use the full power of MathJaX & XyJax to display mathematical content and vectorize diagrams in my questions. Because these apps are provisioned in the tamu.edu domain, it has also enabled me to personalize data to each student using the Google IDP for OAuth-based authentication. It allows me to display the student's attendance record, their relative standing in the class, my feedback for them etc., while being mindful of privacy. If you are interested in improving that bit of software, I'd be happy to bundle it in a form that may be usable by others.

4.3 Battling Canvas at TAMU
The Canvas administrators at TAMU don't permit Javascript or CSS fragments in web pages that you might create for your classes. Input of mathematical formulae is also a very manual process. This can be very cumbersome, especially if you're adding a lot of material on Canvas, and want some structure in your web pages such as section numbers, automatic conversion from LateX formulae to tags that the Canvas server will convert into images etc.

To make this process more automated, I wrote an XSLT style sheet that generates inline styling information for documents written in XML. I generate HTML pages from XML using Python's lxml module, that I then paste into Canvas. You can find the style-sheet and the Python driver here. If you try it, let me know what changes make it run more smoothly for you. You may need to change a few things here and there, but you'll get an idea of where I'm going with it. The set of web pages that you're viewing have been built using the stylesheet.

4.3.1 An example XML
The following XML is translated into the HTML shown below. It shows how sections and subsections get nested numbering. The style sheet handles nesting upto subsubsubsubsection.
<article>
<section title="Week 1">
CSCE 313: Introduction to Computer Systems
<subsection title="Lecture 1">
Class policy. Introduction.
</subsection>

<subsection title="Lecture 2">
<ul>
  <li> Git Overview during labs. </li>
  <li> x86-64 ISA overview. </li>
  <li> Linux environment setup. Watch this video by <a
    href="https://www.youtube.com/playlist?list=PLIZzM4eefg8Cg3P4Mpfj77FUA4ZNlxJF8">Prof. Houngninou</a>.</li>
</ul>
</subsection>
</section>

<section title="Week 2">
This week we'll cover the following topics.
<ul>
  <li> Assembly Language Programming on the x86-64.</li>

  <li> <a href="https://canvas.tamu.edu/files/58847845/download?download_frd=1">CSCE313_0101.pdf</a> (8/29).
  This is about 70 slides out of the 250 slides that cover x86-64 assembly language programming in
  Profs. Bryant &amp; Hallaron's class at CMU. </li>

  <li> x86-64 ISA. <a href="https://cs61.seas.harvard.edu/site/2022/Asm/#gsc.tab=0">Prof. Eddie Kohler's Assembly Page</a></li>
</ul>
</section>
</article>

Its translation generates html that's displayed below.

1 Week 1

CSCE 313: Introduction to Computer Systems

1.1 Lecture 1

Class policy. Introduction.

1.2 Lecture 2

  • Git Overview during labs.
  • x86-64 ISA overview.
  • Linux environment setup. Watch this video by Prof. Houngninou.

2 Week 2

This week we'll cover the following topics.
  • Assembly Language Programming on the x86-64.
  • CSCE313_0101.pdf (8/29). This is about 70 slides out of the 250 slides that cover x86-64 assembly language programming in Profs. Bryant & Hallaron's class at CMU.
  • x86-64 ISA. Prof. Eddie Kohler's Assembly Page
4.3.2 Math for Canvas
<article>
Show that if <m>A, B, C</m> are sets, then
<dm>\overline{A \cap B \cap C} = \overline{A} \cup \overline{B} \cup \overline{C}</dm>
using a membership table.

<p> What can you say about the sets <m>A</m> and <m>B</m> if we know that</p>
<ol>
  <li> <m>A \cup C = B \cup C</m></li>
  <li> <m>A \cap B = A</m></li>
  <li> <m>A - B = A</m></li>
  <li> <m>A \cap B = B \cap A</m></li>
  <li> <m>A - B = B - A</m></li>
</ol>
</article>
Show that if \(A, B, C\) are sets, then \[\overline{A \cap B \cap C} = \overline{A} \cup \overline{B} \cup \overline{C}\] using a membership table.

What can you say about the sets \(A\) and \(B\) if we know that

  1. \(A \cup C = B \cup C\)
  2. \(A \cap B = A\)
  3. \(A - B = A\)
  4. \(A \cap B = B \cap A\)
  5. \(A - B = B - A\)
I register extensions to Python's lxml.etree, and translate raw LaTeX into Canvas acceptable HTML using the following code. Basically, the Canvas server accepts raw LaTeX that is quoted twice.
class MathExtension(etree.XSLTExtension):
    def execute(self, context, self_node, input_node, output_parent):
        eqn = input_node.text
        e = quote(quote(eqn))
        out = f"""<img class="equation_image" src="/equation_images/{e}?scale=.9"/>"""
        output_parent.append(etree.fromstring(out))


class DisplayMathExtension(etree.XSLTExtension):
    def execute(self, context, self_node, input_node, output_parent):
        eqn = input_node.text
        e = quote(quote(eqn))
        out = f"""<p style="display:block;text-align:center;margin: 8px 0 5px 0;"><img class="equation_image" src="/equation_images/{e}?scale=1"/></p>"""
        output_parent.append(etree.fromstring(out))
4.4 Writing Docker containers for Gradescope
Phillip Ritchey has something similar that he uses for his Data Structures classes and if you're interested in developing autograders for your class, you should also talk to him. I wrote a basic autograder for CSCE 111 about a year and a half ago, so these instructions may no longer be accurate. But it'll serve as a high level overview of how to build a container for testing student submissions.

Let's say that students are tasked with writing a Java program that converts fahrenheit to celsius.

  • When a student submits their code (in this simple example it's just one Java file F2C.java), it's available in /autograder/submission in the Docker container.
  • Gradescope eecutes the file run_autograder and expects that the output will be a json file formatted as below that lists each test case that was run, the student's score for the test and the maximum score for the test.
      {
        "tests": [
          {
            "Test Case": "Test with argument 104.8",
            "score": 10,
            "max_score": 10
          },
          {
            "Test Case": "Test with argument 98.4",
            "score": 10,
            "max_score": 10
          }
        ],
        "score": 20
      }  
      
    
  • To simplify running tests and parsing the output of test cases, we use Python in this example. run_autograder is a bash script that serves as a test harnes for running various tests. It looks like the following.
      #!/usr/bin/env bash
    
      cd /autograder/source
      cp /autograder/submission/F2C.java /autograder/source
    
      cd /autograder/source
      javac F2C.java
    
      # Run the autograder code
      python3 runtest.py
      python3 genout.py
      cat /autograder/results/results.json
      
    
  • runtest.py looks as follows.
      import re
      import unittest
      import subprocess
    
    
      # See https://github.com/gradescope/autograder_samples/blob/master/python/src/tests/test_simple.py
      # https://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method
      class TestF2C(unittest.TestCase):
          JAVA = "java"
    
          def setUp(self):
              pass
    
          def tearDown(self):
              pass
    
          def add_score(self, score):
              with open("result", "a") as W:
                  W.write(f"{score}\n")
    
          def test_one(self):
              cmd = [TestF2C.JAVA, "F2C", "104.8"]
              data = ''
              with subprocess.Popen(cmd, stdin=None, bufsize=-1, stdout=subprocess.PIPE) as proc:
                  data = proc.stdout.read()
              val = data.decode('utf-8')
              if re.search(r"^\s*40.4", val):
                  self.add_score(10)
              else:
                  self.add_score(0)
              #self.assertRegex(val, r"^\s*40.4", "Incorrect response to 104.8")
    
          def test_two(self):
              cmd = [TestF2C.JAVA, "F2C", "98.4"]
              data = ''
              with subprocess.Popen(cmd, stdin=None, bufsize=-1, stdout=subprocess.PIPE) as proc:
                  data = proc.stdout.read()
              val = data.decode('utf-8')
              if re.search(r"^\s*36\.8", val):
                  self.add_score(10)
              else:
                  self.add_score(0)
              #self.assertRegex(val, r"^\s*41", "Incorrect response to 98.4")
    
    
      if __name__ == '__main__':
          unittest.main()
      
    
    runtest.py runs the tests and appends a score out of 10 for each test, one entry per line into the file results.
  • After the tests have executed, we generate the json formatted output that encapsulates the test results. That code looks as follows.
      import json
    
      TESTS = {
          0: "Test with argument 104.8",
          1: "Test with argument 98.4"
      }
      total = 0
      out = {}
    
      with open("result", "r") as R:
          scores = R.readlines()
    
      for s in scores:
          total += int(s)
    
      out["score"] = total
      out["tests"] = []
      for i, s in enumerate(scores):
          out["tests"].append({
              "score": int(s),
              "max_score": 10,
              "Test Case": TESTS[i] if i in TESTS.keys() else "???"
          })
    
      with open("/autograder/results/results.json", "w") as W:
          W.write(json.dumps(out, indent=2))
      
    
    The code is quite straightforward.
What we've described is a basic shell of an autograder workflow. It can be made a lot more sophisticated. We invite you to send us your code that considers many more error conditions during the execution of test cases.

Here's a basic Dockerfile that creates a container with JDK in it.

FROM ubuntu:bionic

RUN apt-get -y update
RUN apt-get -y install software-properties-common
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get -y install openjdk-11-jdk
RUN apt install python3
WORKDIR /autograder/submission
COPY F2C.java .
WORKDIR /autograder/source
COPY run_autograder .
COPY *.py .
WORKDIR /autograder/results
RUN touch results.json
WORKDIR /autograder/source
4.5 Epic Pen
When giving a lecture in ZACH, you can always use the pen attached to the PC to annotate your Powerpoint slides, or your PDF documents. These apps interpret the movement of the pen device and translate them as markings in the app. However, in my CSCE313 class I often ssh into a GCP Ubuntu VM and run lots of command lines in the shell, run emacs to display code snippets etc., run gdb and sometimes do all of the above on my (local) mac which I display on ZACH monitors as an extension monitor.

Students have complained that when I point to stuff on the big podium display with my hand, they can’t see it and would like me to point to things by marking them on the display. (I would have preferred a more amphitheater-like classroom where everyone looks at the podium, but the table displays have inexorably trained students over time into staring at their closest monitor!) So how can you mark text that appears in your Powershell or iterm2 window?

Enter the Epic Pen. Also talk to Ted Seidel who offered this tip. Basically, install the Epic Pen software and you can annotate any portion of the display! It's also available in the OS image deployed on the ZACH PC's.