Skip to content

Instantly share code, notes, and snippets.

@crystalattice
crystalattice / gist:4d5817236574885acc30
Last active August 29, 2015 14:07
Weapon vs AC to-hit modifiers
//dam_sm_min and dam_lg_min = minimum number of dice required for the damage roll
//dam_sm_max and dam_lg_max = maximum number of dice required for the damage roll
//dam_modifier = the constant value added to the die roll, based on the damage spread
//For example, a weapon that does 2-7 points of damage to small or medium opponents
// would have a dam_sm_min = 1, a dam_sm_max = 6, and a dam_modifier = 1.
on("chat:message", function(msg) {
// Exit if not an api command
if (msg.type != "api") return;
// Get the API Chat Command
@crystalattice
crystalattice / SQL_queries.sql
Last active November 26, 2017 01:44
Unit 1, Lesson 2, Project 2
--part 1
SELECT
trip_id,
duration
FROM
trips
ORDER BY duration DESC
LIMIT 5
--part 2
@crystalattice
crystalattice / Aggregate_SQL_Queries.sql
Last active November 26, 2017 02:40
Unit 1, Lesson 2, Project 3
--Question 1
SELECT
Date,
Max(MaxTemperatureF) max_temp,
Zip
FROM
weather
--Question 2
SELECT
@crystalattice
crystalattice / SQL_joins.sql
Last active November 26, 2017 04:12
Unit 1, Lesson 2, Project 4
--Question 1
WITH rain_day AS
(SELECT
date
FROM
weather
WHERE
weather.Events LIKE 'rain'
GROUP BY 1)
1. Sleep study
a. Set up test population, as many people as possible
i. Survey candidates to see whether they currently use sleeping medication, have insomnia, etc. to ensure the group is as homogenous as possible
b. Randomly assign people to control and test groups
i. Check to see that the random assignment didn’t accidently assign a larger proportion of a particular category to one sample group, e.g. more men than women in the test group
c. Generate hypothesis: “The medication will result in more restful sleep, as indicated by REM time and minimal movement.”
d. Outcome: REM-time sleep will increase and there is a decrease in restlessness
e. Other measures: Check to see that a suitable cross-section of people is represented, i.e. gender, age range, etc., unless the medication is designed for a particular group of people
2. Gym uniforms
a. Test population can be both current members and potential members
Biases
1. Measuring response in the winter vs. summer will skew the results towards the summer. If a seasonal check wanted to be made, a spring/summer check would be better.
2. People w/ anxiety are more likely to seek treatment than the general population. Many people think they are normal, or at least don’t think they suffer from anxiety, so they wouldn’t come to an anxiety clinic.
3. Correlation != causation. Including a special code on the billboard advertisement, i.e. a special URL, would show whether the increased traffic was due to the advertisement or something else. You would also have to see if there were any other possible influences to web traffic; at a minimum, look at historical traffic for that time frame as well as monitor traffic for a time period into the future.
4. It takes time for many marketing schemes to bear fruit, especially as regular and new customers may not have come in immediately after the new program was started. Advertising (or lack thereof) for the new program also has to be
Experiment challenge
1. There are a total of 100 participants; one group saw 40% effectiveness and the other saw 10%.
a. These were tested on droids, so who knows what their programming dictates.
b. The test subjects were captives, so motivation may play a part.
c. The test giver was different for each group, leading to observer bias of the results. The Emperor could be more persuasive because of his position.
d. What was the makeup of the droid population? If they were the same model, then individual biases should be null. However, different models may reflect different tendencies.
e. Were the sample groups homogenous or heterogeneous? (see previous bullet)
f. How were the slogans presented to the sample groups? Different deliveries may yield different results.
g. The best solution is to have one person, ideally a disinterested third-party, present the slogans to both groups, using the same presentation style. As much as possible, the droids should
To prevent cheating, a teacher writes three versions of a test. She stacks the three versions together, first all copies of Version A, then all copies of Version B, then all copies of Version C. As students arrive for the exam, each student takes a test. When grading the test, the teacher finds that students who took Version B scored higher than students who took either Version A or Version C. She concludes from this that Version B is easier, and discards it.
Problem: Which test questions are sufficient in meeting the goals of the course, ensuring students have adequately retained the information, while not being too easy or too difficult for students to answer?
Hypothesis: Providing a selection of tests, each with different questions, will determine which questions meet the criteria of ensuring students have adequately retained the material.
Experiment Design: Create a test bank of questions, then randomly print these questions on each test that will be handed out. The questions need to be evenly weighted in
#####################################
#Dice_roller.py
#
#Purpose: A random number generation program that simulates
# various dice rolls.
#Author: Cody Jackson
#Date: 4/11/06
#
#Copyright 2006 Cody Jackson
#This program is free software; you can redistribute it and/or modify it
1) What is the 1994 rate of juvenile delinquency in the U.S.? Good
2) What can we do to reduce juvenile delinquency in the U.S.? Bad
a) What has been done to address juvenile delinquency?
b) What are the most effective ways to reduce delinquency?
3) Does education play a role in reducing juvenile delinquents' return to crime? Good
4) How many customers does AT&T currently serve in Washington, DC? Good
5) What factors lead consumers to choose AT&T over other service providers? Good
6) How can AT&T attract more customers? Bad
a) For a given scenario, does the number of customers increase?
7) Why did the Challenger Shuttle explode? Bad