Skip to content

Instantly share code, notes, and snippets.

View primaryobjects's full-sized avatar

Kory Becker primaryobjects

View GitHub Profile
@primaryobjects
primaryobjects / circuit.txt
Last active February 13, 2023 20:47
Quantum computing circuit to superimpose two emoticons ;) and 8) using entanglement. https://github.com/primaryobjects/oracle/blob/master/emoticon.py
┌───┐
q_0: ┤ X ├─────
└───┘
q_1: ──────────
q_2: ──────────
┌───┐
q_3: ┤ X ├─────
└───┘
q_4: ──────────
// O(nlogn)
public class Solution {
// Helper class to store coordinates and their distances from the source.
private class Coord
{
public int row;
public int col;
public int distance;
public Coord()
public class Solution {
public bool RepeatedSubstringPattern(string s) {
bool result = false;
// Determine length of string.
int length = s.Length;
// Determine number of unique characters.
int letters = 0;
Dictionary<char, bool> hash = new Dictionary<char, bool>();
@primaryobjects
primaryobjects / calories.R
Last active December 1, 2022 19:11
Day 1 - Advent of Code 2022 - Calorie Counting for Elves and Reindeer https://adventofcode.com/2022/day/1
# Read input.txt file.
lines <- readLines('input.txt')
# Assign unique numbers to each group, separated by a blank line from the file.
i <- cumsum(lines == '')
# Group the values per the above unique numbering.
values <- by(lines, i, strtoi)
# Remove NA values.
@primaryobjects
primaryobjects / quiz3.txt
Last active May 12, 2023 03:36
Improving Communication Skill, Module 3 Quiz: Deception and Apologies, https://www.coursera.org/learn/wharton-communication-skills
1. Which of the following is NOT a fundamental truth about deception?
1 point
Deception is both chronic and often successful
Deception is hardwired
@primaryobjects
primaryobjects / quiz2.txt
Created October 23, 2022 02:06
Improving Communication Skill, Module 2 Quiz: Building Trust and Cooperation, https://www.coursera.org/learn/wharton-communication-skills
Question 1
Many of our most pressing problems—from conserving water to reducing pollution to paying taxes—are examples of:
1 point
Cooperative Dilemma
* Social Dilemma
Prisoner's Dilemma
Collective Dilemma
@primaryobjects
primaryobjects / quiz1.txt
Created October 23, 2022 02:02
Improving Communication Skill, Module 1 Quiz: Comparisons, Cooperation, and Competition https://www.coursera.org/learn/wharton-communication-skills
Module 1 Quiz: Comparisons, Cooperation, and Competition
1.
Question 1
Peter,
Angela, and Opie work together at the Pawtucket Brewery. They worked closely as
a team to promote Pawtucket new craft beer. They started working at Pawtucket
the same year and they often socialize together.
At the end of the year, Opie was selected
@primaryobjects
primaryobjects / index.css
Created October 3, 2022 00:19
Simple page load time and count statistics. Useful for reloading the page and counting the number of page loads. https://jsfiddle.net/9gjdo6qe/1/
.card {
min-height: 150px;
}
@primaryobjects
primaryobjects / quiz4.txt
Last active September 16, 2022 13:54
Mindware: Critical Thinking for the Information Age, Week 2, Lesson 4, Quiz 4 https://www.coursera.org/learn/mindware/
1. Correlation is just as good as an experiment at determining causality.
False
2. The treatment in an experiment is considered the _____________. The thing that is measured in an experiment is considered the _________
Independent variable/dependent variable
3. Shortly after the new CEO took over Company Z, its stocks began to fall. John blames the change in stock value on poor management by the CEO. Why does John not have enough information to draw this conclusion (besides having a small sample size of one company)?
There's no "control group," and we don't know what would have happened to this company without the "treatment" - that is, without this new CEO. It is also possible that its stocks would have plummeted even more dramatically, but the new CEO prevented this worse outcome.
4. Many control variables in multiple regression analysis have very high validity but very low reliability.
@primaryobjects
primaryobjects / quiz1.txt
Last active September 16, 2022 13:54
Mindware: Critical Thinking for the Information Age, Week 1, Lesson 1, Quiz 1 https://www.coursera.org/learn/mindware/
Question 1
From this list, choose the example that is a variable:
1 / 1 point
* The number of hours of daylight in a day
The number of degrees in a right angle
The distance from Los Angeles to El Paso
The direction that the Earth rotates around the Sun
Question 2
From this list, choose the example that is a constant