This file contains 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
// Useful for AES encryption. | |
// Pad the ciphertext with zeros until it is of length blockSize. | |
func ZerosPad(ciphertext []byte, blockSize int) []byte { | |
// determine number of zeros to add | |
padLen := blockSize - (len(ciphertext) % blockSize) | |
padText := bytes.Repeat([]byte{0}, padLen) | |
ciphertext = append(ciphertext, padText...) |
This file contains 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
usingnamespace @import("bits.zig"); | |
pub const CW_USEDEFAULT: DWORD = 0x80000000; | |
// https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles | |
pub const WS_OVERLAPPED = 0x00000000; | |
pub const WS_POPUP = 0x80000000; | |
pub const WS_CHILD = 0x40000000; | |
pub const WS_MINIMIZE = 0x20000000; | |
pub const WS_VISIBLE = 0x10000000; |
This file contains 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
const gdi32 = @import("gdi32.zig"); | |
pub usingnamespace @import("std").os.windows; | |
pub const VOID = c_void; | |
pub const HWND = HANDLE; | |
pub const WPARAM = UINT_PTR; | |
pub const LPARAM = LONG_PTR; | |
pub const LRESULT = LONG_PTR; | |
pub const HICON = HANDLE; | |
pub const HCURSOR = HICON; |
This file contains 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
module multiformattedtext; | |
/************************************************************************ | |
* | |
* File: MultiformattedText.cpp | |
* | |
* Description: | |
* | |
* | |
* This file is part of the Microsoft Windows SDK Code Samples. |
This file contains 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
@:allow(SparseMatrixIterator) | |
@:allow(SparseMatrixKeyValueIterator) | |
class SparseMatrix<T> { | |
final _rows:Array<Int>; | |
final _cols:Array<Int>; | |
final _values:Array<T>; | |
public function new() { | |
_rows = new Array(); |
This file contains 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
param ( | |
[string]$username | |
) | |
while ($true) { | |
$timestamp = [DateTimeOffset]::Now.ToUnixTimeSeconds() | |
$videosDir = "$env:USERPROFILE\Videos\$username" | |
if (-not (Test-Path -Path $videosDir)) { |