This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| start,clear | |
| store C | |
| IF, LOAD A | |
| skipcond 400 / skip next line if ac is 0 | |
| jump mult | |
| quit, load C | |
| output | |
| halt | |
| mult, load C | |
| ADD B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for file in *.zip ; do | |
| #remove the .zip extension from the file name | |
| bfile=$(basename "$file" .zip) | |
| #extract the band name. As the band name is the first part of the file, | |
| #there might be trailing spaces so use sed to remove those | |
| BAND=$(echo "$bfile" | cut -d- -f1 | sed 's/ $//'); | |
| #the second part of the file name after the dash is the album name | |
| #there might be spaces before / after the band name so use sed to | |
| #remove those. | |
| #in either case, spaces within the band or album name are left untouched. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| enum class weekdays { MON, TUE, WED, THU, FRI, SAT, SUN }; | |
| const std::string daynames[] = {"monday", "tuesday", "wednesday", "thursday", | |
| "friday", "saturday", "sunday"}; | |
| #define WEEKLENGTH 7 | |
| int main() { | |
| for (int iter = 0; iter < WEEKLENGTH; iter++) { | |
| std::cout << daynames[iter] << '\n'; | |
| switch (weekdays(iter)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| tease() { | |
| echo "echo no, you can't do that" | |
| echo "ha ha" | |
| } | |
| trap tease SEGV | |
| trap tease INT | |
| trap tease KILL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #define ERROR -1 | |
| int main(int argc, char **argv) { | |
| int ch; | |
| int hasa = 0, hasb = 0, hasc = 0; | |
| const char *barg = NULL; | |
| while (ch = getopt(argc, argv, "ab:c"), ch != ERROR) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from time import sleep | |
| import sys | |
| from multiprocessing import Process # needed for process management | |
| secs = 0 | |
| def forever(start : int, stop: int) -> None: | |
| global secs | |
| current : int = start | |
| while True: | |
| if current == stop: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #define REQ_ARGS 2 | |
| #define NUM_ARGS 1 | |
| #define TOTAL 4 | |
| /*Boolean to enable the functio to be used*/ | |
| typedef enum { | |
| FALSE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(void) { | |
| char *s = "hello"; | |
| char *t = "hello"; | |
| if (s == t) { | |
| printf("omg! they are equal!\n"); | |
| } | |
| printf("addresses: %p %p\n", s, t); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int main(void) { | |
| char word[1]; | |
| strcpy(word, "haappy birthday"); | |
| return EXIT_SUCCESS; | |
| } |