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
** Filename: Employee.java | |
* Author: Ndatta Fall | |
* Purpose: Salesman employee classes with salary information | |
* | |
*/ | |
public class Salesman extends Employee{ | |
private int annualSales;// to store annual sales |
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
/** Filename: Employee.java | |
* Author: Ndatta Fall | |
* Purpose: Executive employee classes with salary information | |
* | |
*/ | |
public class Executive extends Employee{ | |
private int stockPrice; |
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
/** Filename: Endingclass.java | |
* Author: Ndatta Fall | |
* | |
* Purpose of Program: Calculates salary for different types of employees, and displays their information | |
*/ | |
import java.io.File; | |
import java.io.FileNotFoundException; |
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
/** Filename: Employee.java | |
* Author: Ndatta Fall | |
* | |
* Purpose: Employee, classes with salary information | |
* | |
*/ | |
public class Employee { |
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
<?php | |
if(isset($_POST['submit'])){ | |
$name_bad = $_POST['name']; | |
$name_bad = mysql_real_escape_string($name_bad); | |
$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'"; | |
echo "<span style='color:green'>Escaped Bad Injection: <br />" . $query_bad . "<br />"; | |
echo "mysql_real_escape_string() function has helped escape mysql injections<br><br></span>"; | |
} |
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
<?php | |
if(isset($_POST['submit'])){ | |
$name = $_POST['name']; | |
// user input that uses SQL Injection | |
$name_bad = $_POST['name']; | |
$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'"; | |
// display what the new query will look like, with injection | |
echo "<span style='color:red'>Injection: " . $query_bad."<br>"; |
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
def lambda_handler(event, context): | |
print_log(context) | |
area_of_triangle = get_area_of_triangle(event) | |
return { | |
'area_of_triangle' : area_of_triangle | |
} | |
def get_area_of_triangle(event): | |
b = int(event['base']) | |
h = int(event['height']) |
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
mport boto3 | |
dynamodb = boto3.resource('dynamodb') | |
table = dynamodb.Table('courses') | |
print(table.creation_date_time) | |
with table.batch_writer() as batch: | |
batch.put_item( | |
Item={ | |
'courseID':2, | |
'Title': 'Building Secure Web Applications', |
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
mport boto3 | |
dynamodb = boto3.resource('dynamodb') | |
table = dynamodb.Table('courses') | |
print(table.creation_date_time) | |
with table.batch_writer() as batch: | |
batch.put_item( | |
Item={ | |
'courseID':2, | |
'Title': 'Building Secure Web Applications', |
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 | |
# Get the service resource. | |
dynamodb = boto3.resource('dynamodb') | |
# Create the DynamoDB table. | |
table = dynamodb.create_table( | |
TableName='courses', | |
KeySchema=[ | |
{ | |
'AttributeName': 'courseID', |
NewerOlder