GitHub Pages Mini Project
%%javascript
var compsci_joke_list = [
{ joke: "Why do programmers prefer dark mode? Because light attracts bugs.", complexity: "O(1)" },
{ joke: "Why do Java developers wear glasses? Because they don't see sharp.", complexity: "O(1)" },
{ joke: "How many programmers does it take to change a light bulb? None, that's a hardware problem.", complexity: "O(1)" },
{ joke: "Why do programmers hate nature? It has too many bugs.", complexity: "O(n)" },
{ joke: "Why do Python programmers prefer snake_case? Because they can't C.", complexity: "O(1)" },
{ joke: "Why was the JavaScript developer sad? Because he didn't know how to 'null' his feelings.", complexity: "O(1)" },
{ joke: "Why do programmers always mix up Christmas and Halloween? Because Oct 31 == Dec 25.", complexity: "O(1)" },
{ joke: "Why did the programmer quit his job? Because he didn't get arrays.", complexity: "O(n)" },
{ joke: "Why do programmers prefer using the terminal? Because they don't like Windows.", complexity: "O(1)" },
{ joke: "Why was the function sad after a breakup? It couldn't find its closure.", complexity: "O(1)" }
];
var randomIndex = Math.floor(Math.random() * compsci_joke_list.length);
var selectedJoke = compsci_joke_list[randomIndex];
console.log("Joke #" + (randomIndex + 1) + ": " + selectedJoke.joke + " (Complexity: " + selectedJoke.complexity + ")");
<IPython.core.display.Javascript object>
%%javascript
var accounting_joke_list = [
"Why did the accountant cross the road? To bore the people on the other side.",
"What do accountants do when they're constipated? They work it out with a pencil.",
"Why don't accountants read novels? Because the only numbers in them are page numbers.",
"How does an accountant stay out of debt? He learns to act his wage.",
"Why did the accountant break up with the calculator? It couldn't handle his complex calculations.",
"Why did the accountant stare at his glass of orange juice for three hours? Because on the box it said 'concentrate'.",
"Why did the accountant bring a ladder to work? To reach the high interest rates.",
"Why did the accountant get promoted? Because he knew how to balance his work and play.",
"Why did the accountant go broke? Because he lost his balance.",
"Why did the accountant get a job at the bakery? Because he was good at making dough.",
"Why did the accountant get a job at the zoo? Because he was good with cheetahs.",
"Why did the accountant get a job at the bank? Because he was good at counting on it.",
"Why did the accountant get a job at the library? Because he was good at keeping books.",
"Why did the accountant get a job at the circus? Because he was good at juggling numbers.",
"Why did the accountant get a job at the restaurant? Because he was good at serving up the numbers.",
"Why did the accountant get a job at the gym? Because he was good at working out the numbers.",
"Why did the accountant get a job at the hospital? Because he was good at taking care of the accounts.",
"Why did the accountant get a job at the school? Because he was good at teaching the numbers.",
"Why did the accountant get a job at the farm? Because he was good at counting the chickens before they hatched."
]
var randomIndex = Math.floor(Math.random() * accounting_joke_list.length);
console.log("Joke #" + (randomIndex + 1) + ": " + accounting_joke_list[randomIndex]);
<IPython.core.display.Javascript object>
var compsci_joke_list = [
{ joke: "Deadpool and Wolverine", complexity: "O(1)" },
{ joke: "The Wild Robot", complexity: "O(1)" },
{ joke: "Harry Potter", complexity: "O(1)" },
{ joke: "Avatar: The Way of Water", complexity: "O(n)" },
{ joke: "Top Gun: Maverick", complexity: "O(1)" },
{ joke: "Jurrasic World", complexity: "O(1)" },
{ joke: "Captain America", complexity: "O(1)" },
{ joke: "Despicable Me 3", complexity: "O(n)" },
{ joke: "Skyfall", complexity: "O(1)" },
{ joke: "The Lord of the Rings", complexity: "O(1)" }
];
var randomIndex = Math.floor(Math.random() * compsci_joke_list.length);
var selectedJoke = compsci_joke_list[randomIndex];
console.log("Joke #" + (randomIndex + 1) + ": " + selectedJoke.joke + " (Complexity: " + selectedJoke.complexity + ")");
<IPython.core.display.Javascript object>
%%javascript
var accounting_joke_list = [ “Why did the accountant cross the road? To bore the people on the other side.”, “What do accountants do when they’re constipated? They work it out with a pencil.”, “Why don’t accountants read novels? Because the only numbers in them are page numbers.”, “How does an accountant stay out of debt? He learns to act his wage.”, “Why did the accountant break up with the calculator? It couldn’t handle his complex calculations.”, “Why did the accountant stare at his glass of orange juice for three hours? Because on the box it said ‘concentrate’.”, “Why did the accountant bring a ladder to work? To reach the high interest rates.”, “Why did the accountant get promoted? Because he knew how to balance his work and play.”, “Why did the accountant go broke? Because he lost his balance.”, “Why did the accountant get a job at the bakery? Because he was good at making dough.”, “Why did the accountant get a job at the zoo? Because he was good with cheetahs.”, “Why did the accountant get a job at the bank? Because he was good at counting on it.”, “Why did the accountant get a job at the library? Because he was good at keeping books.”, “Why did the accountant get a job at the circus? Because he was good at juggling numbers.”, “Why did the accountant get a job at the restaurant? Because he was good at serving up the numbers.”, “Why did the accountant get a job at the gym? Because he was good at working out the numbers.”, “Why did the accountant get a job at the hospital? Because he was good at taking care of the accounts.”, “Why did the accountant get a job at the school? Because he was good at teaching the numbers.”, “Why did the accountant get a job at the farm? Because he was good at counting the chickens before they hatched.” ] var randomIndex = Math.floor(Math.random() * accounting_joke_list.length); console.log(“Joke #” + (randomIndex + 1) + “: “ + accounting_joke_list[randomIndex]);
<IPython.core.display.Javascript object>