This file contains 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
public int yearsTilOneMillion(double initialBalance) { | |
int year = 1; | |
double savings = initialBalance; | |
while (savings < 1000000){ | |
savings = savings * 1.05; | |
year++; | |
} | |
return year; | |
} |
This file contains 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
/* | |
* find the biggest and smallest | |
*/ | |
public int findRange(int[] intArray) { | |
if(intArray.length == 0){ //check that the array is bigger than 0 | |
return -1; | |
} | |
int largest = intArray[0]; | |
int smallest = intArray[0]; | |
for (int x=1;x<intArray.length;x++){ // find the smallest |
This file contains 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
/* THIS IS BROKEN, NEEDS TO BE FIXED | |
* This question is taken from Udacity Lesson 4, Problem Set Question 8 | |
*/ | |
public class hello{ | |
public static void main(String[] args){ | |
roll(); | |
System.out.println(monopolyRoll()); | |
} |
This file contains 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
## Python 2.7 | |
## GlueLastRunDuration.py | |
## Version 1 | |
## by Lydon Carter October 2018 | |
## USE | |
# Script to get a specific AWS Glue Job and tell you the duration of | |
# the last run. | |
# Notes: | |
# -- The script will use the location you setup for your Glue Context in the "Needed stuff" |
This file contains 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
import boto3 | |
database_name = "databse" | |
table_name = "prefix-dir_name" | |
new_table_name = "more_awesome_name" | |
client = boto3.client("glue") | |
response = client.get_table(DatabaseName=database_name, Name=table_name) | |
table_input = response["Table"] | |
table_input["Name"] = new_table_name |