Posted by jpluimers on 2017/02/22
A while ago, I bitched that Microsoft moved away the Windows Update out of the Control panel into a language depended place (in Windows 10 1511 update broke the Hyper-V networking – Fix network connection issues).
Since then I had to maintain too many locales running Windows 10. So here is the batch file:
for /f "delims=" %%A in ('PowerShell -Command "(Get-Culture).Name"') do explorer "%LocalAppData%\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\%%A\AAA_SystemSettings_MusUpdate_UpdateActionButton.settingcontent-ms"
It uses these tricks:
- Set output of a command as a variable (in this case a for loop variable)
- Execute PowerShell script in a .bat file
- PowerShell Get-Culture (which gets a .NET CultureInfo instance)
- CultureInfo.Name property (which has the nl-NL, en-US, etc codes in it)
It replaced this simple batch-file which has worked for like 10 years:
%windir%\System32\rundll32.exe url.dll,FileProtocolHandler wuapp.exe
via: Windows Update Shortcut – Create in Windows 10 – Windows 10 Forums
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Batch-Files, CommandLine, Development, Power User, PowerShell, Scripting, Software Development, Windows, Windows 10 | Leave a Comment »
Posted by jpluimers on 2017/02/21
… there’s no need to use WaitForMultipleObjects in Step 2. It’s fairly easy to keep a counter of active threads in the pool (interlocked-incremented when a thread starts, interlocked-decremented when a thread is finished). When the counter reaches zero (no more active threads), signal an event. With only one event to wait for, you can use WaitForSingleObject…
So no more 64-thread (MAXIMUM_WAIT_OBJECTS) limits for pools…
Source: Delphi and stuff: The strange limitation of 64 threads
Posted in Delphi, .NET, Software Development, Development, Power User, Windows | Leave a Comment »
Posted by jpluimers on 2017/02/09
Brilliant Date format converter from dates in Text (almost any format) or timestamp numbers in Unix, Mac, Filetime or Microsoft (which is the same as Delphi TDateTime) format to any of these formats:
Date in human-readable text
|Wednesday, March 23, 2016 4:05:39pm
RFC 822 formatted date
|Wed, 23 Mar 2016 16:05:39 +0000
ISO 8601 formatted date
seconds since Jan 1 1970
seconds since Jan 1 1904
days since Dec 31 1899
100-nanoseconds since Jan 1 1601
Source: Date format converter
Posted in *nix, .NET, Apple, Delphi, Development, Mac, OS X, Power User, Software Development | 1 Comment »
Posted by jpluimers on 2017/01/17
I will probably need this again somewhere in the future: An exponential back-off implementation I used somewhere; probably room for improvement, but it works good enough.
It’s Delphi, but I’ve not seen practical implementations in C# either.
(the updated version thanks to Anders Melander).
Posted in .NET, C#, Delphi, Development, Software Development | 5 Comments »
Posted by jpluimers on 2017/01/17
This is still one of my gripes from Visual Studio: when a changeset is linked to an incorrect work item, you still have to change this from the work item side:
You cannot change it from the changeset UI, but you can change it from most work item UI’s. You can just add a link to a the specific changeset and the changeset will show the link as well.
You have to be careful with the steps too:
- Link it from the correct work item as a changeset link
- Unlink it from the wrong work item
If you do it in reverse order, and get the changeset number wrong, you will have an orphan changeset.
Source: visual studio 2010 – In TFS how can I correct the links to work items on an existing changeset – Stack Overflow
Posted in Development, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio 2010, Visual Studio 2012, Visual Studio 2013, Visual Studio 2015, Visual Studio and tools | Leave a Comment »