threadsperblock = 32
blockspergrid = (an_array.size + (threadsperblock - 1)) // threadsperblock
increment_by_one[blockspergrid, threadsperblock](an_array)
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 <chrono> | |
| #include "../common/book.h" | |
| #define N (1 << 16) | |
| // element count: 65536 | |
| // max blocks -> 65535 | |
| // max threads per block -> 512 | |
| using namespace std; |
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 <chrono> | |
| #include "../common/book.h" | |
| #include "../common/cpu_anim.h" | |
| #define DIM 1024 | |
| using namespace std; | |
| using namespace std::chrono; | |
| // 2D array of blocks and dimensions |
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 <cstring> | |
| #include <sstream> | |
| #include <iomanip> | |
| #ifndef SHA256_CUH | |
| #define SHA256_CUH | |
| #include <string> | |
| #include <array> |
Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.
The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).
| Style | Input | Output (12-hour clock) | Output (24-hour clock) |
|---|---|---|---|
| Default | <t:1543392060> |
November 28, 2018 9:01 AM | 28 November 2018 09:01 |
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
| using System.Security.Claims; | |
| using System.Text; | |
| using System.IdentityModel.Tokens.Jwt; | |
| using Microsoft.IdentityModel.Tokens; | |
| namespace Diamond; | |
| public static class JwtTokenManager | |
| { |
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
| using System.Threading.Tasks.Dataflow; | |
| namespace AsyncQueue; | |
| /// <summary> | |
| /// A thread-safe asynchronous queue. | |
| /// </summary> | |
| /// <example> | |
| /// <code> | |
| /// var queue = new AsyncQueue`int(); |
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 warning disable CS0649 | |
| using ILGPU; | |
| using ILGPU.Runtime; | |
| namespace Hasher; | |
| public unsafe struct Sha256 | |
| { | |
| /**************************** VARIABLES *****************************/ |
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
| using System.Security.Cryptography; | |
| using Newtonsoft.Json; | |
| namespace Crypto; | |
| public struct PrivateKey | |
| { | |
| private byte[] D { get; init; } | |
| private byte[] P { get; init; } |