Archive for the ‘Development’ Category
Posted by jpluimers on 2016/09/22
For my own reference as RegEx is a write-only language:
Search for pipes means just back-slash escaping them:
grep "\|S\|" products.txt > s-rated-products.txt
Search for optional charactes (in this case searching for both the singular and plural form of a word) can be done by grouping the optional part in parentheses:
grep -i "Movie(s)?" products.txt > movie-products.txt
Search for either OR:
grep -E "foo|bar" products.txt > foo-or-bar-products.txt
egrep "foo|bar" products.txt > foo-or-bar-products.txt
Note that the Borland grep does not support the OR syntax, but egrep does.
–jeroen
via:
Posted in Development, RegEx, Software Development | Leave a Comment »
Posted by jpluimers on 2016/09/21
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2007, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2016/09/21
These NirSoft tools helped me finding out about some crashes that never made it to the event log:
At first I thought my own software development caused them, but In the end they were caused by buggy video drivers.
–jeroen
Posted in Development, Power User, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2016/09/21
It’s been in the System.Array class forever, but remarkably few people do know that it can throw you a NotSupportedException (for instance when calling Add, Insert, Remove, etc).
It does because it implements IList, but not all methods implemented from IList are valid.
And it also indicates that, as the IList Properties allows for IsFixedSize to return false.
A similar case is there for IsReadOnly: then you cannot even modify the values.
Ever since I started teaching .NET/C# classes almost 15 years ago, I warned:
beware when you use IList as not everybody implements all methods.
–jeroen
via:
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, Software Development | Leave a Comment »
Posted by jpluimers on 2016/09/20
In the 2009 past, sdelete used the -c parameter to zero wipe clean a hard drive and -z would clean it with a random pattern.
That has changed. Somewhere along the lines, -c and -z has swapped meaning which I didn’t notice.
This resulted in many of my virtual machines image backups were a lot larger than they needed to be.
The reason is that now:
-c does a clean free space with a random DoD conformant pattern (which does not compress well)
-z writes zeros in the free space
Incidently, -c is a lot slower than -z as well.
TL;DR: use this command
sdelete -z C:
Where C: is the drive to zero clean the free space.
–jeroen
Posted in Batch-Files, Development, Fusion, Hyper-V, Power User, Proxmox, Scripting, sdelete, Software Development, SysInternals, View, VirtualBox, Virtualization, VMware, VMware ESXi, VMware Workstation, Windows | Leave a Comment »
Posted by jpluimers on 2016/09/20
I wrote two tiny batch files that would dump the environment variables from the registry.
Various reasons:
- Environment variables can be stored in two contexts: System and User (SET will show them all at once and for instance combine PATH up to 1920 characters).
- Environment variables can be set to auto-expand or not, which you cannot see from a SET command (REG_EXPAND_SZ versus REG_SZ).
show-user-environment-variables.bat:
reg query "HKCU\Environment"
show-system-environment-variables.bat:
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
Filtered results:
Read the rest of this entry »
Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows NT, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista, Windows XP | Leave a Comment »
Posted by jpluimers on 2016/09/15
7-zip can uncompress a truckload of formats, but what if you need formats it doesn’t support or you want to integrate decompression in your own software?
Then some libraries can be really useful provided you regularly update them (otherwise you – like Symantec – can run in substantial security risks).
Formats supported:
Pre-compiled console wrappers around libmspack for many platforms.
Libraries and pre-compiled console applications for many platforms.
Background on CHM files.
–jeroen
Via:
Symantec dropped the ball here. A quick look at the decomposer library shipped by Symantec showed that they were using code derived from open source libraries like libmspack and unrarsrc, but hadn’t updated them in at least 7 years.
Source: Project Zero: How to Compromise the Enterprise Endpoint
Posted in 7zip, Compression, Development, Power User, Software Development | Leave a Comment »