From e35c2b8a716b3ec244bfa9985f51c5b8e00c57b0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 22 Oct 2014 10:32:51 +0100 Subject: [PATCH] Added pseudo code algorithms to make programming faster (Some may have already been integrated) --- Algorithms/check drive capacity.pseudo | 5 +++++ Algorithms/check drive is recorded.pseudo | 4 ++++ Algorithms/check if compression.pseudo | 3 +++ Algorithms/detect user logged in.pseudo | 3 +++ Algorithms/has drive changed since backup.pseudo | 5 +++++ 5 files changed, 20 insertions(+) create mode 100644 Algorithms/check drive capacity.pseudo create mode 100644 Algorithms/check drive is recorded.pseudo create mode 100644 Algorithms/check if compression.pseudo create mode 100644 Algorithms/detect user logged in.pseudo create mode 100644 Algorithms/has drive changed since backup.pseudo diff --git a/Algorithms/check drive capacity.pseudo b/Algorithms/check drive capacity.pseudo new file mode 100644 index 0000000..1483750 --- /dev/null +++ b/Algorithms/check drive capacity.pseudo @@ -0,0 +1,5 @@ +(USB_Location, Drive_Location) +freeSpace <-- getCapacity(Drive_Location) +driveFiles <-- getCapacity(USB_Location) +if driveFiles > freeSpace then return True +else return False diff --git a/Algorithms/check drive is recorded.pseudo b/Algorithms/check drive is recorded.pseudo new file mode 100644 index 0000000..93dc360 --- /dev/null +++ b/Algorithms/check drive is recorded.pseudo @@ -0,0 +1,4 @@ +(DriveFormat, DriveName, DriveCapacity) +result <-- ExecuteSQL("SELECT BackupName FROM backups WHERE driveFormat = {} AND DriveName = {} AND DriveCapacity = {};") +if results is None then return False +Else Return True \ No newline at end of file diff --git a/Algorithms/check if compression.pseudo b/Algorithms/check if compression.pseudo new file mode 100644 index 0000000..56055af --- /dev/null +++ b/Algorithms/check if compression.pseudo @@ -0,0 +1,3 @@ +(BackupName, DriveName, DriveCapacity) +wantsCompression <-- ExecuteSQL("SELECT isCompressed FROM backupTable WHERE driveName = {} AND BackupName = {} AND DriveCapacity = {}", DriveName, BackupName, DriveCapacity) +return wantsCompression diff --git a/Algorithms/detect user logged in.pseudo b/Algorithms/detect user logged in.pseudo new file mode 100644 index 0000000..c3d0292 --- /dev/null +++ b/Algorithms/detect user logged in.pseudo @@ -0,0 +1,3 @@ +add c# user reference +username <-- computer.UserName() +return username \ No newline at end of file diff --git a/Algorithms/has drive changed since backup.pseudo b/Algorithms/has drive changed since backup.pseudo new file mode 100644 index 0000000..d21c33e --- /dev/null +++ b/Algorithms/has drive changed since backup.pseudo @@ -0,0 +1,5 @@ +(backupName, driveLetter) +driveHash <-- calculateHash(driveLetter) +backupHash = ExecuteSQL("SELECT Hash FROM Backups WHERE backupName = {}", backupName) +if backupName is driveHash then return False +Else return True \ No newline at end of file