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
| #ifndef TK_COLORS_HPP | |
| #define TK_COLORS_HPP | |
| #include <cstdint> | |
| #define RGB2U32_(R, G, B) ((uint32_t(R) << 16) | \ | |
| (uint32_t(G) << 8) | \ | |
| uint32_t(B)) | |
| #define COLOR_ENTRY(N,R,G,B) {N, RGB2U32_((R),(G),(B))} |
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
| unsigned char rndtable[256] = | |
| { | |
| 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66, 74, 21, | |
| 211, 47, 80, 242, 154, 27, 105, 128, 150, 116, 34, 11, 19, 73, 31, 114, | |
| 25, 46, 137, 210, 211, 41, 41, 100, 248, 14, 129, 24, 180, 244, 239, 9, | |
| 121, 4, 72, 47, 197, 147, 85, 18, 167, 130, 214, 221, 142, 214, 158, 96, | |
| 99, 119, 17, 59, 121, 28, 42, 223, 174, 98, 254, 203, 171, 12, 145, 137, | |
| 34, 18, 161, 88, 251, 22, 219, 251, 127, 86, 36, 79, 181, 127, 189, 11, | |
| 58, 33, 177, 181, 242, 182, 42, 191, 153, 7, 38, 189, 135, 210, 10, 23, |
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 <ctype.h> | |
| #include <string.h> | |
| #include <stdbool.h> | |
| #define EOS '\0' | |
| #define FNM_NOMATCH 1 /* Match failed */ | |
| #define FNM_NOESCAPE 0x01 /* Disable backslash escaping */ | |
| #define FNM_PATHNAME 0x02 /* Slash must be matched by slash */ | |
| #define FNM_PERIOD 0x04 /* Leading period must be matched by period */ |
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 <stdint.h> | |
| // #include <stdio.h> | |
| #define DEBUGOUT(MSG) fputs(MSG, stderr) | |
| #define EOL "\n" | |
| #define GET_NIBBLE(V,N) (((V) >> ((N) * 4)) & 0x0F) | |
| #define IS_NOT_PRINTABLE(C) (((C) < 0x20) || ((C) > 0x7E)) | |
| static void hexDump(const char *desc, void *addr, int len) | |
| { |
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 <stdint.h> | |
| #define MASK_BITS 4 | |
| typedef union | |
| { | |
| float f; | |
| uint32_t i; | |
| } float_uint_t; |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <conio.h> | |
| void plot(int x, int y, int c) | |
| { | |
| gotoxy(x+1,y+1); | |
| putchar(c); | |
| putchar(8); |
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 <windows.h> | |
| #include <shobjidl.h> | |
| #include <wrl/client.h> | |
| class TaskbarProgress | |
| { | |
| private: | |
| HWND m_hwnd; | |
| Microsoft::WRL::ComPtr<ITaskbarList3> m_taskbarList; |
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
| import ctypes | |
| from ctypes.wintypes import HWND | |
| # Windows Taskbar State Constants (TBPFLAG) | |
| STATE_NO_PROGRESS = 0x0 | |
| STATE_INDETERMINATE = 0x1 # Marquee/indeterminate indicator (when time is unknown) | |
| STATE_NORMAL = 0x2 # Green indicator | |
| STATE_ERROR = 0x4 # Red indicator | |
| STATE_PAUSED = 0x8 # Yellow indicator |
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 <stdint.h> | |
| #include <stdlib.h> | |
| uint32_t tiny_rand(void) | |
| { | |
| uint32_t t = _seed; | |
| t ^= t >> 10; | |
| t ^= t << 9; | |
| t ^= t >> 25; |
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
| WITH RECURSIVE t(x) AS (SELECT 0 UNION ALL SELECT x + 1 FROM t LIMIT 8 * 16) | |
| SELECT group_concat(substr('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', | |
| abs(random()%(62))+1,1), '') | |
| AS PASSWORD FROM t GROUP BY x % 16; |
NewerOlder