Skip to content

Instantly share code, notes, and snippets.

View els-pnw's full-sized avatar

Eric Sammons els-pnw

View GitHub Profile
def find_outlier(integers):
parities = []
for i in integers:
parities.append(i & 1)
return integers[parities.index((parities[0] in parities[1:3]) ^ parities[0])]
1 [ec2_credentials]
2 username_access_key=<my_ec2_access_key>
3 password_secret_access_key=<my_ec2_secret_access_key>
4 account_number=0000000000000
5 key_file=/replace/my/path/my_ec2_private_key_file.key
6 key_cert_file=/replace/my/path/my_ec2_public_certificate_file.pem
7
if acct["type"] == "ec2":
self.send_text(acct["account_number"], *self.locators.prov_acct_number_field)
time.sleep(10)
#self.send_text(acct["key_file"], *self.locators.prov_acct_key_file_locator)
self.send_text('/This/is/a/test/file', *self.locators.prov_acct_key_file_locator) <- Worked
time.sleep(10)
self.send_text(acct["key_cert_file"], *self.locators.prov_acct_cert_file_locator) <- Failed
time.sleep(10)
self.send_text(acct["provider_account_priority"], *self.locators.prov_acct_prior_field) <- Failed
time.sleep(10)
public class CashRegister {
public static int registers = 0;
public int transactions = 0;
public double amount = 0.00;
public CashRegister() {
registers = registers + 1;
}
public class CashRegister {
public static int registers = 0;
public int transactions = 0;
public double amount = 0.00;
public double AddTransaction(double a) {
amount = amount + a;
return amount;
Complete the following programming assignment and submit your source code to me by uploading the file(s) to the drop box for this assignment, which you'll find near the end of this module. Please be sure to include your last name and the course number in the file name(s), like so: [your name], X436.2, Module 4 Code.
Write a cash register class. It should have the following methods:
AddTransaction(amount) – add an amount to a running total and increments the number of transactions
TransactionCount() – returns the number of transactions received
Total() – returns to total amount of the orders
ResetTransactions() – sets the total amount and transaction count to 0
Register Count() – returns the number of cash registers created
/**
*
* @author Eric Sammons
* @course x436.2
* @assignment Module 3
*
*/
public class ReverseString {
/**
* Will reverse a string.
/**
*
* @author Eric Sammons
* @course x436.2
* @assignment Module 2
*
*/
public class ReverseString {
/**
* Will reverse a string.
static String reverse(String s) {
/*
* @param s
*/
while(s.length() != 0) {
/*
* Some learning code, to visualize what's going on
*/
System.out.println("The string " + s);
System.out.println("The substring 1 + length " + s.substring(1, s.length()));
login_org_name_selector_css = ('a')