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
// In OnInitDialog() | |
CRect rc; GetClientRect( rc ); | |
CDC* winDC = GetDC(); | |
CDC memDC; memDC.CreateCompatibleDC( winDC ); | |
int const savedDC = memDC.SaveDC(); | |
m_bitmap.CreateCompatibleBitmap( winDC, rc.Width(), rc.Height() ); | |
memDC.SelectObject( m_bitmap ); |
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
/* | |
Copyright (c) 2020 zett42. | |
https://github.com/zett42 | |
MIT License | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
pipeline { | |
agent any | |
stages { | |
stage('Test') { | |
steps { | |
myfun() | |
} | |
} | |
} | |
} |
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
#--------------------------------------------------------------------------------------------------------------- | |
# Defines keyboard shortcut Alt+E for the console to edit current input in VSCode | |
# (edit the line that starts with "code" to use another editor). | |
# | |
# This code is an extension of this StackOverflow answer: | |
# https://stackoverflow.com/a/71175083/7571258 | |
# | |
# New features: | |
# - Saves/restores the current cursor position (if the text hasn't changed too much). | |
# - Passes the current cursor position to VSCode, so the editors cursor gets positioned as in the console. |
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
/* Copyright 2022 zett42 | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files | |
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, | |
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
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
# Pester tests for TemporaryTypeData.psm1 | |
BeforeAll { | |
Import-Module $PSScriptRoot\TemporaryTypeData.psm1 -Force | |
} | |
Describe 'Invoke-WithTemporaryTypeData' { | |
It 'invokes a script block with temporary type data' { |
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
<# Copyright 2022 zett42 | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files | |
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, | |
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
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
// Calculates line and column from character index. | |
(int, int ) CalcLineAndColumn( string text, int pos ) { | |
// Count the number of line breaks before pos. | |
int line = 0, lastLf = -1; | |
int lf = text.IndexOf( '\n' ); | |
while( lf != -1 && lf < pos ) { | |
++line; | |
lastLf = lf; | |
lf = text.IndexOf( '\n', lf + 1 ); |
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
using System; | |
using System.Linq; | |
using BenchmarkDotNet.Running; | |
using BenchmarkDotNet.Attributes; | |
using System.Text.RegularExpressions; | |
namespace Benchmark_IndexOfFirstNonWhitespaceChar { | |
class Program { | |
static void Main( string[] args ) { |
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
/* Copyright 2022 zett42 | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files | |
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, | |
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
OlderNewer