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
| // Example program | |
| #include <vector> | |
| #include <cstdio> | |
| struct Data { | |
| int ref; | |
| int type; | |
| int start; | |
| int end; | |
| }; |
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
| static int GetFontWeight(const std::string& styleStr) | |
| { | |
| std::string lowerStr = ::ToLower(styleStr); | |
| const char* style = lowerStr.c_str(); | |
| if (std::strlen(style) == 0 || | |
| std::strstr(style, "normal") != nullptr || | |
| std::strstr(style, "regular") != nullptr) | |
| return 400; | |
| else if (std::strstr(style, "thin") != nullptr) | |
| return 100; |
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
| static inline float PointsToPixels(float points, float dpi) | |
| { | |
| // 1 pt = 0.352778 mm | |
| float mm = 0.352778f * points; | |
| // 1 inch = 25.4 mm | |
| float inches = mm / 25.4f; | |
| return dpi * inches; | |
| } | |
| static inline float PixelsToPoints(float pixels, float dpi) | |
| { |
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 <map> | |
| #include <memory> | |
| template <class Key, class Data> | |
| class DataCache | |
| { | |
| public: | |
| template<typename... Args> | |
| std::shared_ptr<Data> GetData(const Key& key, Args... args) | |
| { |
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
| #if defined(_WIN32) || defined(_WIN64) // Windows | |
| # include <shlobj.h> | |
| #endif | |
| #include <string> | |
| #include <vector> | |
| #include <filesystem> | |
| static std::vector<std::wstring> GetStandardFontsLocations() | |
| { |
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
| /** | |
| * Drag scroller 0.2.0 | |
| * @author Shtille <[email protected]> | |
| * @license MIT | |
| */ | |
| (function (global, factory) { | |
| typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | |
| typeof define === 'function' && define.amd ? define(factory) : | |
| (global = global || self, global.DragAutoScroller = factory()); | |
| }(this, (function() { 'use strict'; |
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
| /** | |
| * To use this module simply run: | |
| * ~~~{.sh} | |
| * node pack_file.js | |
| * ~~~ | |
| */ | |
| const fs = require('fs'); | |
| const zlib = require('zlib'); |
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
| #!/bin/zsh | |
| android_abi=armeabi-v7a | |
| android_platform=android-19 | |
| path_to_cmakelists=~/Documents/dev/src/smartplatform-CMake | |
| path_to_generated=~/Documents/dev/src/build | |
| path_to_ndk=~/Library/Android/sdk/ndk/24.0.8215888 | |
| path_to_ninja=/usr/local/bin/ninja |
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 <cstdlib> | |
| #include <cstdio> | |
| #include <thread> | |
| #include <string> | |
| #include <chrono> | |
| #include <atomic> | |
| #include <pthread.h> | |
| class ScopeTimer { |
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
| /** | |
| * Copyright (c) 2021 Vladimir Sviridov. | |
| * Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). | |
| * | |
| * Module defines LRU cache class. | |
| */ | |
| /** | |
| * Defines LRU cache | |
| * |
NewerOlder