Stargate SG-1 S7E9 “Avenger 2.0”

https://www.gateworld.net/sg1/s7/avenger-2-0/

In this episode, Dr. Felger comes up with a virus that is able to remotely disable stargates. After it doesn’t go as planned, Sam comes in to help and we see this montage that involves writing code on a whiteboard.

I thought it was sort of silly how she wasn’t just brainstorming pseudocode here, which is generally the type of thing that I see coders doing with whiteboards. No, that seems to be a full verbose script, written character-for-character. But as I looked closer, it got worse. That language seems to be C#. If we take this situation as literal as possible, that must mean the SGC had come up with some .NET-like middleware framework sort of thing for interacting with the stargate. I would imagine that there were better languages that they could have used instead.

  • slazer2au
    link
    fedilink
    English
    arrow-up
    10
    ·
    13 days ago

    Can be written in python and they will just cross compile it to embedded dhd code.

    Would be funny if they did it in python.

    • SatyrSack@quokk.auOP
      link
      fedilink
      English
      arrow-up
      8
      ·
      edit-2
      11 days ago

      Python would be totally believable. Whether they were to:

      • use Python just for their whiteboard pseudocode brainstorming and then later rewrite that Python in some lower-level language when actually typing the code into the computer
      • use some custom middleware framework that allows them to literally code in Python, but then, like you say, automatically cross-compiles that Python into whatever embedded ancient programming language that the gate actually uses

      Either of those would make more sense than using C# anywhere like they are clearly doing here.

      EDIT:

      import stargate  
      import time  
      
      gate = stargate.gate("username", "password")  
      
      if gate.is_connected():  
          print("Gate connected")  
          gate.iris.open()  
          time.sleep(1)  
          if gate.iris.is_open():  
              print("Iris open")  
              gate.dial(1, 2, 3, 4, 5, 6)  
              time.sleep(1)  
              if gate.is_wormhole_established():  
                  print("Wormhole established")  
                  print("00:00:00.000000", end="\r")  
                  time_start = time.perf_counter()  
                  while gate.is_wormhole_established():  
                      time.sleep(0.1)  
                      time_now = time.perf_counter() -time_start  
                      print(f"{time_now:%H:%M:%S.%f}", end="\r")  
                  gate.iris.close()  
                  time.sleep(1)  
                  if not gate.iris.is_open():  
                      print("Iris closed") 
                      print("Program complete")  
                  else:    
                      print("ERROR: Could not close iris")  
              else:  
                  print("ERROR: Could not establish wormhole")  
          else:  
              print("ERROR: Could not open iris")  
      else:  
          print("ERROR: Could not establish connection to gate")  
      
      • slazer2au
        link
        fedilink
        English
        arrow-up
        4
        ·
        13 days ago

        It could also be the earth gate program is written in c# so they prototype on the digital twin in area 51 to see how it goes.

        I singled out python because snake.