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 "SomeType.hpp" | |
| #define S SomeType | |
| #define T unsigned char | |
| S operator&(S const l, S const r) { return (S)((T)l & (T)r); } | |
| S operator^(S const l, S const r) { return (S)((T)l ^ (T)r); } | |
| S operator|(S const l, S const r) { return (S)((T)l | (T)r); } | |
| S &operator&=(S &l, S const r) { return l = l & r; } |
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
| start %SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %~1 |
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
| cls && echo Connect ... && %WinDir%\System32\rasdial.exe "Connection name" "login" "password" | |
| cls && echo Disconnect ... && pause | |
| %WinDir%\System32\rasdial.exe "Connection name" /DISCONNECT && cls | |
| cls |
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
| // Main.cpp | |
| #include <ctime> | |
| #include <iostream> | |
| #include "Matrix.h" | |
| int main(int argc, char const *argv[]) { | |
| Matrix<int> matrix(3, 5); | |
| srand(time(nullptr)); | |
| matrix.init([]() -> int { return rand() % 10; }); |
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> | |
| int main(void) { | |
| unsigned int v3 = 2359778272; // bin(10001100101001110101101111100000) == dec(2359778272) == hex(8CA75BE0) | |
| do | |
| printf(" %i", v3 & 31); | |
| while(v3 >>= 1); | |
| return 0; | |
| } | |
| // Output: 0 16 24 28 30 31 15 23 27 13 22 11 21 26 29 14 7 19 9 20 10 5 18 25 12 6 3 17 8 4 2 1 |
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> | |
| int main(void) { | |
| unsigned short v2 = 42736; // bin(1010011011110000) == dec(42736) == hex(A6F0) | |
| do | |
| printf(" %i", v2 & 15); | |
| while(v2 >>= 1); | |
| return 0; | |
| } | |
| // Output: 0 8 12 14 15 7 11 13 6 3 9 4 10 5 2 1 |
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> | |
| int main(void) { | |
| unsigned char v = 184; // bin(10111000) == dec(184) == hex(B8) | |
| do | |
| printf(" %i", v & 7); | |
| while(v >>= 1); | |
| return 0; | |
| } | |
| // Output: 0 4 6 7 3 5 2 1 |