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 <algorithm> | |
| #include <iostream> | |
| #include <iterator> | |
| #include <streambuf> | |
| template<char C> | |
| class FilterBuf : public std::streambuf | |
| { | |
| char readBuf_; | |
| const char* pExternBuf_; |
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 <cmath> | |
| #include <cstdio> | |
| #include <vector> | |
| #include <iostream> | |
| #include <algorithm> | |
| #include <unordered_map> | |
| #include <iterator> | |
| #include <sstream> |
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
| /* | |
| f(n) = f(n - 1) + f(n - 2) | |
| Applying the equation farther, substituting f(n - 1) = f(n - 2) + f(n - 3): | |
| f(n) = 2 * f(n - 2) + f(n - 3) | |
| Substituting f(n - 2) = f(n - 3) + f(n - 4): | |
| f(n) = 3 * f(n - 3) + 2 * f(n - 4) | |
| Substituting f(n - 3) = f(n - 4) + f(n - 5): | |
| f(n) = 5 * f(n - 4) + 3 * f(n - 5) | |
| It can be seen that the coefficients are Fibonacci numbers by themselves! |
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 <vector> | |
| #include <iostream> | |
| class Counter | |
| { | |
| enum { MaxVal = 256 }; | |
| public: | |
| void update(int idx, int val) { | |
| while (idx <= MaxVal) { | |
| tree[idx] += val; |
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 <algorithm> | |
| #include <iostream> | |
| #include <fstream> | |
| #include <functional> | |
| #include <sstream> | |
| #include <string> | |
| #include <cctype> | |
| #include <cstdio> | |
| using std::cout; |
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
| C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props: | |
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <!-- add this stuff --> | |
| <PropertyGroup Label="Globals"> | |
| <VcpkgEnabled>false</VcpkgEnabled> | |
| </PropertyGroup> | |
| </Project> |
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
| #pragma once | |
| #include <ComSvcs.h> | |
| #include <atlbase.h> | |
| #include <comdef.h> | |
| #include <comutil.h> | |
| ////////////////////////////////////////////////////////////////////////// | |
| class CComUsageScope |
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 <tuple> | |
| #include <type_traits> | |
| auto some_function = [](auto&& x) { std::cout << x << std::endl; }; | |
| template<class Tuple, size_t... Indices> | |
| constexpr void Apply_impl(Tuple& tpl, std::index_sequence<Indices...>) | |
| { |
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 T, typename V> | |
| auto TryToFind(T& collection, const V& value) -> decltype(&collection.end()->second) | |
| { | |
| auto it = collection.find(value); | |
| return (it != collection.end()) ? &it->second : nullptr; | |
| } |
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
| @echo off | |
| setlocal enableextensions | |
| rem %1 is either x86 or x64, %2 is either Win32 or x64 | |
| set POCO_INSTALL_PREFIX=d:\Poco | |
| set POCO_SOURCE_PATH=D:\workspace\poco-poco-1.9.0-release | |
| set OPENSSL_ROOT_DIR=D:\workspace\stuff\External\openssl.%1 | |
| for /f "tokens=*" %%a in ( |
OlderNewer