diff --git a/.github/workflows/AutoRelease.yml b/.github/workflows/AutoRelease.yml new file mode 100644 index 0000000..46668fe --- /dev/null +++ b/.github/workflows/AutoRelease.yml @@ -0,0 +1,23 @@ +name: AutoRelease + +on: + push: + branches: [ main, release ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + update-tag: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Get the latest tag + id: get_tag + run: echo "::set-output name=tag::$(git describe --tags --abbrev=0)" + - name: Increment version + id: increment_version + run: echo "::set-output name=version::$(echo ${{ steps.get_tag.outputs.tag }} | awk -F. '{$NF = $NF + 1;} 1' OFS=.)" + - name: Push new tag + uses: EndBug/latest-tag@latest + with: + tag-name: "v${{ steps.increment_version.outputs.version }}" \ No newline at end of file diff --git a/.github/workflows/VStest.yml b/.github/workflows/VStest.yml index 465e848..e4d791f 100644 --- a/.github/workflows/VStest.yml +++ b/.github/workflows/VStest.yml @@ -21,12 +21,12 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' # Ensure submodules are fetched - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v2 - name: Restore NuGet packages working-directory: ${{env.GITHUB_WORKSPACE}} diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 5b54db7..16d902c 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -3,7 +3,7 @@ name: MSBuild on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [ main, release ] pull_request: branches: [ main ] @@ -21,12 +21,12 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v2 - name: Restore NuGet packages working-directory: ${{env.GITHUB_WORKSPACE}} @@ -39,9 +39,9 @@ jobs: run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.7 + uses: gittools/actions/gitversion/setup@v1.1.1 with: versionSpec: '5.x' - name: Determine Version - uses: gittools/actions/gitversion/execute@v0.9.7 + uses: gittools/actions/gitversion/execute@v1.1.1 diff --git a/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.cpp b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.cpp new file mode 100644 index 0000000..4ee157b --- /dev/null +++ b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.cpp @@ -0,0 +1,69 @@ +// ExampleForSort.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include +#include +#include +#include +#include + +void generateRandomNumbers(std::vector& vec, int size) { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(1, 10000); + + vec.clear(); + vec.reserve(size); + for (int i = 0; i < size; ++i) { + vec.push_back(dis(gen)); + } +} + + +void measurePerformance(const std::vector& vec, const std::string& description) { + auto start = std::chrono::high_resolution_clock::now(); + std::vector sortedVec = vec; + std::sort(sortedVec.begin(), sortedVec.end()); + auto end = std::chrono::high_resolution_clock::now(); + std::chrono::duration sortDuration = end - start; + std::cout << "Time taken to sort " << description << ": " << sortDuration.count() << " seconds\n"; + + start = std::chrono::high_resolution_clock::now(); + bool isSorted = std::is_sorted(sortedVec.begin(), sortedVec.end()); + end = std::chrono::high_resolution_clock::now(); + std::chrono::duration checkDuration = end - start; + std::cout << "Time taken to check if sorted " << description << ": " << checkDuration.count() << " seconds\n"; + std::cout << "Array is sorted: " << (isSorted ? "true" : "false") << "\n"; + + if (description == "already sorted array") { + std::cout << "Performance improvement for checking sorted array: " + << (sortDuration.count() / checkDuration.count()) << " times faster\n"; + } +} + +int main() +{ + const int size = 10000000; + std::vector vec; + generateRandomNumbers(vec, size); + + std::cout << "Performance with random array:\n"; + measurePerformance(vec, "random array"); + + std::cout << "\nPerformance with already sorted array:\n"; + std::sort(vec.begin(), vec.end()); + measurePerformance(vec, "already sorted array"); + + return 0; +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu + +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.sln b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.sln new file mode 100644 index 0000000..1c860a1 --- /dev/null +++ b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExampleForSort", "ExampleForSort.vcxproj", "{0BD47328-C55F-437D-8981-36784B03D239}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0BD47328-C55F-437D-8981-36784B03D239}.Debug|x64.ActiveCfg = Debug|x64 + {0BD47328-C55F-437D-8981-36784B03D239}.Debug|x64.Build.0 = Debug|x64 + {0BD47328-C55F-437D-8981-36784B03D239}.Debug|x86.ActiveCfg = Debug|Win32 + {0BD47328-C55F-437D-8981-36784B03D239}.Debug|x86.Build.0 = Debug|Win32 + {0BD47328-C55F-437D-8981-36784B03D239}.Release|x64.ActiveCfg = Release|x64 + {0BD47328-C55F-437D-8981-36784B03D239}.Release|x64.Build.0 = Release|x64 + {0BD47328-C55F-437D-8981-36784B03D239}.Release|x86.ActiveCfg = Release|Win32 + {0BD47328-C55F-437D-8981-36784B03D239}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj new file mode 100644 index 0000000..98ec1af --- /dev/null +++ b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {0bd47328-c55f-437d-8981-36784b03d239} + ExampleForSort + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj.filters b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj.filters new file mode 100644 index 0000000..022a4df --- /dev/null +++ b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj.user b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/C++/LambdaFunctions/Sort/ExampleForSort/ExampleForSort.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ff57201 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +My changes test \ No newline at end of file diff --git a/GitAction/GitVersion.yml b/GitAction/GitVersion.yml new file mode 100644 index 0000000..ebdfba1 --- /dev/null +++ b/GitAction/GitVersion.yml @@ -0,0 +1,6 @@ +assembly-versioning-scheme: MajorMinorPatch +mode: ContinuousDeployment +branches: {} +ignore: + sha: [] +merge-message-formats: {} diff --git a/GitAction/gitversion.json b/GitAction/gitversion.json index 65912b7..3776269 100644 --- a/GitAction/gitversion.json +++ b/GitAction/gitversion.json @@ -2,34 +2,34 @@ "Major": 0, "Minor": 1, "Patch": 0, - "PreReleaseTag": "gitversion.1", - "PreReleaseTagWithDash": "-gitversion.1", - "PreReleaseLabel": "gitversion", - "PreReleaseLabelWithDash": "-gitversion", - "PreReleaseNumber": 1, - "WeightedPreReleaseNumber": 1, - "BuildMetaData": 39, - "BuildMetaDataPadded": "0039", - "FullBuildMetaData": "39.Branch.gitversion.Sha.828ba5fbbde9a4d7bf635cd59005b85d98c8b24a", + "PreReleaseTag": "release.223", + "PreReleaseTagWithDash": "-release.223", + "PreReleaseLabel": "release", + "PreReleaseLabelWithDash": "-release", + "PreReleaseNumber": 223, + "WeightedPreReleaseNumber": 223, + "BuildMetaData": null, + "BuildMetaDataPadded": "", + "FullBuildMetaData": "Branch.release.Sha.107ced1321253da9ab769a93b18efb2fd3909cc2", "MajorMinorPatch": "0.1.0", - "SemVer": "0.1.0-gitversion.1", - "LegacySemVer": "0.1.0-gitversion1", - "LegacySemVerPadded": "0.1.0-gitversion0001", + "SemVer": "0.1.0-release.223", + "LegacySemVer": "0.1.0-release223", + "LegacySemVerPadded": "0.1.0-release0223", "AssemblySemVer": "0.1.0.0", "AssemblySemFileVer": "0.1.0.0", - "FullSemVer": "0.1.0-gitversion.1+39", - "InformationalVersion": "0.1.0-gitversion.1+39.Branch.gitversion.Sha.828ba5fbbde9a4d7bf635cd59005b85d98c8b24a", - "BranchName": "gitversion", - "EscapedBranchName": "gitversion", - "Sha": "828ba5fbbde9a4d7bf635cd59005b85d98c8b24a", - "ShortSha": "828ba5f", - "NuGetVersionV2": "0.1.0-gitversion0001", - "NuGetVersion": "0.1.0-gitversion0001", - "NuGetPreReleaseTagV2": "gitversion0001", - "NuGetPreReleaseTag": "gitversion0001", + "FullSemVer": "0.1.0-release.223", + "InformationalVersion": "0.1.0-release.223+Branch.release.Sha.107ced1321253da9ab769a93b18efb2fd3909cc2", + "BranchName": "release", + "EscapedBranchName": "release", + "Sha": "107ced1321253da9ab769a93b18efb2fd3909cc2", + "ShortSha": "107ced1", + "NuGetVersionV2": "0.1.0-release0223", + "NuGetVersion": "0.1.0-release0223", + "NuGetPreReleaseTagV2": "release0223", + "NuGetPreReleaseTag": "release0223", "VersionSourceSha": "ed58148b4d0d02ea8fd6f7954e5b241d92ee9a61", - "CommitsSinceVersionSource": 39, - "CommitsSinceVersionSourcePadded": "0039", - "UncommittedChanges": 894, - "CommitDate": "2022-03-05" + "CommitsSinceVersionSource": 223, + "CommitsSinceVersionSourcePadded": "0223", + "UncommittedChanges": 248, + "CommitDate": "2024-07-02" } \ No newline at end of file diff --git a/UnitTest/UnitTest1/HelperFunctions.cpp b/UnitTest/UnitTest1/HelperFunctions.cpp index c91e641..aa38c8a 100644 --- a/UnitTest/UnitTest1/HelperFunctions.cpp +++ b/UnitTest/UnitTest1/HelperFunctions.cpp @@ -3,6 +3,7 @@ #include #include + using namespace std; char* HelperFunctions::GetEnvVariable(std::string name)