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
#region funcs | |
function checkSum { | |
param ( | |
$upnums, | |
[int]$diceroll | |
) | |
$sum = ($upnums | Measure-Object -sum).Sum | |
for ($i=0; $i -lt $upnums.count; $i++){ | |
for ($j=0; $j -lt $upnums.count; $j++){ | |
if (($upnums[$i] + $upnums[$j] -eq $diceroll) -and ($i -ne $j) -or ($upnums[$i] -eq $diceroll) -or ($sum -eq $diceroll)){ |
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
#region notes | |
| |
<# | |
| |
Ryan Tilcock 29-5-2020 | |
v1 - added basic functionality for each alert api method on https://docs.opsgenie.com/docs/alert-api | |
| |
#> | |
| |
#endregion |
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
function Get-MockingText { | |
<# | |
.SYNOPSIS | |
This function changes a normal text string to a TeXt sTrInG LiKe tHiS | |
.DESCRIPTION | |
InTeRnEt cUlTuRe dEmAnDs a qUiCkEr aNd eAsIeR WaY Of tYpInG ThInGs lIkE ThIs. HeNcE ThIs fUnCtIoN. | |
.PARAMETER InputObject |
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
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force | |
$DebugPreference = 'continue' | |
Clear-Host | |
try | |
{ | |
$user = ((Get-WmiObject -Class Win32_ComputerSystem).username).tolower() | |
#$user = $user -replace 'fe.','' |
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 class Point { | |
// Params | |
private int x; | |
private int y; | |
// Constructors | |
public Point() { | |
this(0,0); | |
} |
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 class Wall { | |
// Params | |
private double width; | |
private double height; | |
// Constructors | |
public Wall() { | |
} | |
public Wall(double width,double 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
public class BankAccount { | |
// Params | |
private String accountNumber; | |
private double balance; | |
private String customerName; | |
private String emailAddress; | |
private String phoneNumber; | |
// Constructors |
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 class Person { | |
private String firstName; | |
private String lastName; | |
private int age; | |
public String getFirstName(){ | |
return firstName; | |
} | |
public String getLastName(){ |
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 class SimpleCalculator { | |
private double firstNumber; | |
private double secondNumber; | |
public double getFirstNumber(){ | |
return firstNumber; | |
} | |
public double getSecondNumber(){ | |
return secondNumber; |
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 static int getBucketCount(double width, double height, double areaPerBucket, int extraBuckets) { | |
if ((width <= 0) || (height <= 0) || (areaPerBucket <= 0)||(extraBuckets<0)) { | |
return -1; | |
} | |
double wallArea = (width * height); | |
int bucketsNeeded = (int) ((wallArea / areaPerBucket) - extraBuckets); | |
if (bucketsNeeded < (wallArea/areaPerBucket)){ |
NewerOlder