joshhug
} else if (mode === 'python') { if (cmd === 'exit()') { mode = 'sh'; } else { try { // Safe(ish) eval for demo purposes. // In production, never use eval. Use a JS parser library. // Mapping JS math to appear somewhat pythonesque let result = eval(cmd); if (result !== undefined) output(String(result)); } catch (e) { output(`Traceback (most recent call last):\n File "<stdin>", line 1, in <module>\n${e.name}: ${e.message}`, true); } }
Somewhat amusing 4th wall breaking if you open Python from the terminal in the fake Windows. Examples: 1. If you try to print something using the "Python" print keyword, it opens a print dialog in your browser. 2. If you try to open a file using the "Python" open keyword, it opens a new browser tab trying to access that file.
That is, it's forwarding the print and open calls to your browser.
"Why was the scarecrow given an award?"
"He was out standing in his field."
The fact that a scarecrow's job is to be "out standing in his field", and that excelling at one's job can be phrased as being "outstanding in his field" is an incredible linguistic coincidence.
But very cool!
That semester, I made a slight mistake on the final exam where I asked students to create an algorithm that could find the second shortest path from s to every other vertex in a graph. I forgot to specify that the second shortest path should be simple (i.e. should not reuse any vertex twice). Having to deal with non-simple paths makes the problem much much harder.
None of the students figured it out in the time available, and I'm sure I would also have been stumped if I had tried to solve the problem. Bob figured it out though. And then I remember he graded all 150 solutions to the problem himself, having as a blast as he went through students attempts at an effectively impossible problem.
I asked it "I was watching a show and in the subtitles an umlaut u was rendered as 1/4, i.e. a single character that said 1/4. Why would this happen?"
and it gave a pretty thorough explanation of exactly which encoding issue was to blame.
https://chatgpt.com/share/66e37145-72bc-800a-be7b-f7c76471a1...
But then I asked her to integrate sin(x) * e^x and got this bizarre answer that started out as speech sounds but then degenerated into chaos. Out of curiosity, why and how did she end up generating samples that sounded rather unlike speech?
Here's a recording: https://youtu.be/wWhxF7ybiAc
FWIW, I can get this behavior pretty consistently if I chat with her a while about her voice capabilities and then go into a math question.
1. Given the limited amount of scarce student time I want to spend on this, do pull requests / GitHub actions tests (provided for them) / code reviews seem like the right team processes to introduce?
2. Each student's work is independent of every other student's. Is there some way to have them working on different pieces of the same problem, or having the students solutions interact in some deeper way than random selection in a lottery? On my first post of this idea, a user named taftster imagined taking inspiration from Factorio in some way, with students each contributing some piece of a large system.
3. Is there a way we could naturally allow pull requests for the contest code or maybe even the README that establishes how to review pull requests? I'm thinking a bit about Fluxx or Nomic here.
1. Given the limited amount of scarce student time I want to spend on this, do pull requests / GitHub actions tests (provided for them) / code reviews seem like the right team processes to introduce?
2. Each student's work is independent of every other student. Is there some way to have them working on different pieces of the same problem, or having the students solutions interact in some deeper way than random selection in a lottery? A user named taftster imagined taking inspiration from Factorio in some way, with students each contributing some piece of a system. I've so far lacked the creativity to imagine what the API for this might look like for this assessment.
3. Is there a way we could have students make pull requests for the contest code itself? I'm thinking a bit about Fluxx here.
I'm a Berkeley prof. Working at a startup led me to update my 1500-person class
Student time is incredibly precious. The hope here is that students will spend less than an hour on this, and in the process get a taste of how code reviews / automation can help teams function better. I'm hoping I can thread the needle and give them tools that will help them more efficiently complete their capstone project at the end of the semester, without spending too much of their time teaching them these tools.
FWIW, we have discussed the idea of a lower division software engineering class, and I was really hoping Pamela Fox would do this before she headed back to industry (interesting story there: https://blog.pamelafox.org/2022/05/my-experience-as-unit-18-...). We do have an upper div software engineering course as well, though it's not taken by most of our students.
Taking inspiration from Factorio in some way is an interesting proposition. Will consider!
I had a fun assignment back in the day when I taught security at Princeton back in 2012. In the final assignment, assignment 8 students were given a Linux disk image of a hard drive owned by a guy named Nefarious who had committed a murder. This was an assignment originally created by J Alex Halderman and Ed Felton, but I went a little extra.
In the assignment text, I mentioned that Nefarious was originally arrested due to an anonymous tip from a pseudonymous "Cecco Beppe". Buried in /home/root on Nefarious's drive, there is an innocuously labeled file: CB.7z, which is notable only in that it is the only file on the drive dated 2012 (intentionally), years newer than all of the files on the drive. If one went to the trouble of unzipping this file, they'd realize it is a very small disk image inside the disk image.
Booting this image dropped the user into a chat with a depressed artificial intelligence (a custom ALICE chat bot, but with some hard coded responses to advance my story, this was pre-GPT) who, when prodded with the appropriate keywords, told the tale of depression and attempted AI suicide that followed Hapless Victim's death -- leaving the AI nothing more than a pathetic incoherent chat bot. Further prodding led the AI to reveal the existence of secret assignment #9 as well as a URL for said assignment.
At the URL, there is a zip file containing a flawed pseudorandom generator, a file encryption tool that uses said PRGen, an encrypted file, and a truncated copy of the corresponding plaintext. The truncated plaintext explains that their next task is to complete decryption of the file, which they can do by exploiting the flaw in the PRGenerator.
The deciphered text then explains that their next task is to go back to the HW1 autograder and submit a new solution for HW1 (which was to develop a PRGen) -- but with the catch that they may only use print statements.
Once they submitted this cheating print statement code via the usual Princeton web submit, the Princeton web submit script explained the final part of secret assignment 9, which is to steal the source code for the PRGen autograder that graded their first assignment. No hints were given.
This last part could be done by simply writing code that opening the .class files and prints them to the screen when the autograder script runs.
I had around 10 students (out of ~150) figure this all out, it was great.
2. I agree it's a bad use of student time to see if someone's submission is unique, but I suspect there are ways we could structurally push students to do something unique, e.g. gus_massa's post below.
3. Yeah, it's a little weird. The integer submission is just to keep the macguffin of the assignment going. Also for N submissions, we'll use at least N-1 comparators. If we use RNG that cycles through every comparator before repeating, we can make sure everyone gets used at least once.
Some specific open questions I have:
1. How can I nudge students towards being creative with their comparators so that we get more variety?
2. Is there a natural extension that would get students working on the same files, yielding a richer demonstration of CI?
3. Could we allow students to somehow edit the contest code itself without breaking the entire idea of the project?