items with asterick (*) considered more advanced/esoteric
- Stack vs heap (memory)
- What are both
- when is the stack used
- when is the heap used
- how can the heap be avoided
- performance of the heap
- Cache locality
- Object lifetime
| param([Parameter(Mandatory, Position=0)]$ExePath) | |
| $exeBytes = Get-Content $ExePath -AsByteStream -TotalCount 4096 | |
| $peOffset = [BitConverter]::ToInt32($exeBytes, 0x3c) | |
| $machine = [BitConverter]::ToUInt16($exeBytes, $peOffset + 4) | |
| switch ($machine) | |
| { | |
| 0x014c { "x86" } | |
| 0x8664 { "x64" } | |
| 0xAA64 { "ARM64" } |
| #define UNICODE | |
| #include <Windows.h> | |
| #include <PowrProf.h> | |
| #pragma comment(lib, "PowrProf.lib") | |
| const wchar_t szDeviceName[] = L"NVIDIA USB Type-C Port Policy Controller"; | |
| int main() |
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
| "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,0e,00,3a,00,00,00,00,00 | |
| //headers for fake music (to disable it) | |
| typedef struct { } Mix_Music; | |
| int Mix_PlayMusic(void* dat, int n) { return 0; } | |
| Mix_Music* Mix_LoadMUS(char* s) { return 0; } | |
| int Mix_GetError() { return 0; } | |
| int Mix_FadeOutMusic(int n) { return 0; } | |
| int Mix_FadeInMusic(void* d, int nn, int n) { return 0; } | |
| int Mix_PlayingMusic() { return 0; } | |
| int Mix_CloseAudio() { return 0; } |
| List { | |
| Name: "Entity properties editor"; | |
| IsModal: true; | |
| HorizontalAlignment: Alignment.Middle; | |
| VerticalAlignment: Alignment.Middle; | |
| BackgroundColor: [32 0 128 192]; | |
| Margin: 10; | |
| Padding: 10; | |
| Children: [ |
| ProjectileClass { | |
| Name: "Missile"; | |
| MuzzleVelocity: 500; | |
| DestroyIfOffscreen: True; | |
| IgnoreTrace: True; | |
| Range: 200; | |
| FadeEffect: { | |
| Effects: [ | |
| EntityEffect { |
| function Vec2(X, Y) | |
| { | |
| this.x = X; | |
| this.y = isNaN(Y) ? X : Y; | |
| }; | |
| Vec2.prototype = | |
| { | |
| toString: function() | |
| { | |
| return "{x: " + this.x + ", y: ", + this.y + "}"; |
items with asterick (*) considered more advanced/esoteric
| //comment | |
| /* also a comment */ | |
| //defines a custom binary operator | |
| //with left-associativity and precidence of 15 | |
| //prefix and postfix are both urnary operators | |
| //ternary operators can be emulated with tuples | |
| #operator =!= infix left 15 | |
| vあr = 3 + 5.0 * 4; |