This file contains hidden or 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
# Considering the test function in a given location | |
# you can ignore the following line | |
"function test{""Original Test""}" > test.ps1 | |
# This is a sample of the stub that would peform the function of | |
# finding and downloading the original function. For the sake of | |
# the test we can consider that's already done in test.ps1 in $PWD | |
function test | |
{ | |
"Stub Test" |
This file contains hidden or 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
# Load libraries | |
[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | |
# Selection box | |
$input = [Microsoft.VisualBasic.Interaction]::MsgBox("Do you agree?", 'YesNoCancel,Question', "Respond Please") | |
# Process input as desired | |
switch($input) | |
{ | |
'Yes' |
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
#include <ctime> | |
// A random number generator | |
void fillRandom(vector<int> &iArray) | |
{ | |
srand((unsigned)time(0)); | |
for(int i = 0; i < iArray.size(); i++) | |
{ |
This file contains hidden or 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
// Random Generator | |
template <typename Comparable> | |
void fillRandom(vector<Comparable> &iArray) | |
{ | |
srand((unsigned)time(0)); | |
for(vector<Comparable>::size_type i = 0; i < iArray.size(); i++) | |
{ | |
iArray[i] = rand(); | |
} | |
} |
This file contains hidden or 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
// Fill an array with random numbers | |
template <typename Comparable> | |
void fillRandom(vector<Comparable> &iArray, Comparable range) | |
{ | |
srand((unsigned)time(0)); | |
for(Comparable i = 0; i < iArray.size(); i++) | |
{ | |
iArray[i] = rand() % range; | |
} | |
} |
This file contains hidden or 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
// Fill a random vector | |
template <typename Comparable> | |
void fillRandom(vector<Comparable> &iArray, Comparable range) | |
{ | |
srand((unsigned)time(0)); | |
for(Comparable i = 0; i < iArray.size(); i++) | |
{ | |
iArray[i] = rand() % range; | |
} | |
} |
This file contains hidden or 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
$xMessage = @() | |
$xMessage += " --------------# | \\ // |# | \\// |# | //\\ |# | // \\ |# --------------".Replace( ` | |
"#", (" " * ($host.UI.RawUI.BufferSize.Width - 16 - 4)) ) | |
$xMessage += " ----------------# | \\ // |# | \\ // |# | // \\ |# | // \\ |# ----------------".Replace( ` | |
"#", (" " * ($host.UI.RawUI.BufferSize.Width - 17 - 4))) | |
$chgIdx = 0 | |
$index = 0 | |
while($true) | |
{ |
This file contains hidden or 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
[CmdletBinding()] | |
param ( | |
[parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$Path = (Get-Location), | |
[parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[ValidateNotNullOrEmpty()] | |
[string[]]$Files = ("*.cpp", "*.h"), |
This file contains hidden or 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
template<typename Comparable> void bubbleSort(vector<Comparable> &a); | |
template<typename Comparable> void bubbleSortInverted(vector<Comparable> &a); | |
template <typename Comparable> | |
void bubbleSort(vector<Comparable> &a) | |
{ | |
bool sorted = false; | |
for(int pass = 1; pass < a.size() && !sorted; pass++) | |
{ |
NewerOlder