From my link archive:
- c# – How did you extend your Assert class – Stack Overflow.
- Argument Validation.
- Posting Guards: Guard Classes explained « AJ’s blog.
- CuttingEdge.Conditions – Source Code.
- .NET Guard Class Library? – Stack Overflow.
–jeroen
Posted by jpluimers on 2013/12/05
From my link archive:
–jeroen
Posted in .NET, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/12/04
From my link archive:
Note that for importing decimal/numeric columns, you have two options:
Some more links on this:
–jeroen
Posted in Algorithms, CSV, Database Development, Development, Floating point handling, Software Development, SQL Server, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012 | Leave a Comment »
Posted by jpluimers on 2013/12/03
StackOverflow user User Sertac Akyuz posted a small Delphi snippet showing how to switch the Windows JIT debugger.
I’ll need to complete it somewhere, but since the concept is interesting, here is his answer:
Write a simple application that would launch the debugger you want in case of an application crash.
Register your app in
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebugIn case of an 64bit OS, also to the following key
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebugadd/modify the string named Debugger with value:
"C:..\Win32\Debug\Project1.exe" %ld %ldA very simple application:
procedure TForm1.FormCreate(Sender: TObject); begin ComboBox1.Items.Add('BDS 16'); ComboBox1.Items.Add('BDS 15'); ComboBox1.Items.Add('WinDbg'); ComboBox1.Items.Add('VS'); // etc.. ComboBox1.ItemIndex := 0; end; procedure TForm1.Button1Click(Sender: TObject); var proc: THandle; begin Assert(ParamCount >= 2); proc := OpenProcess(SYNCHRONIZE, False, StrToInt(ParamStr(1))); case ComboBox1.ItemIndex of 0: ShellExecute(0, '', 'C:\..\RAD Studio\9.0\bin\bds.exe', PChar(Format('/attach:%s;%s', [ParamStr(1), ParamStr(2)])), '', SW_SHOWNORMAL); 1 : // etc.. 2: ShellExecute(0, '', 'C:\Program Files (x86)\..\windbg.exe', PChar(Format('-p %s -e %s -g', [ParamStr(1), ParamStr(2)])), '', SW_SHOWNORMAL); 3: ShellExecute(0, '', 'C:\Windows\system32\VSJitDebugger.exe', PChar(Format('-p %s -e %s', [ParamStr(1), ParamStr(2)])), '', SW_SHOWNORMAL); //.. end; if Bool(proc) then begin WaitForSingleObject(proc, INFINITE); Application.Terminate; end; end;
–jeroen
Posted in .NET, Delphi, Development, Software Development, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2013/11/29
I just got this error when SQL Server Management Studio 2012 was complaining about the owner of a certain SQL Server 2012 database and tried to copy that message to the clipboard:
This message cannot be copied to the clipboard.
Additional information
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.
Ensure that your Main function has STAThreadAttribute marked on it. (System.Windows.Forms)
Is there anyone who knows how to workaround this issue in SSMA?
–jeroen
Posted in Database Development, Development, Software Development, SQL Server, SQL Server 2012 | Tagged: SQL Server 2012, SQL Server Management Studio 2012 | Leave a Comment »
Posted by jpluimers on 2013/11/28
There are a few more messages in the “Missed Schedule” backlog, and I really hope that WordPress is going to address this really annoying bug soon as I have to recheck my blog multiple times a day now.
Back on topic:
I’m taking Delphi and Bitbucket here as an example, but this holds for many more development tools and version control tools.
Ultimately, you want changes to be as simple as this one: only the relevant changed lines show up as an actual change.
But often changes include convoluted non-relevant information.
A few things development tools should not do: Read the rest of this entry »
Posted in .NET, C#, Delphi, Development, DVCS - Distributed Version Control, Software Development, Source Code Management, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2013/11/28
Learned something new today:
the effect of a DLL forwarder. The code for the function DsAddressToSiteNameW doesn’t live in netapi32.dll. Instead, netapi32.dll has an export table entry that says “If anybody comes to me asking for DsAddressToSiteNameW, send them to logoncli!DsAddressToSiteNameW instead.”
–jeroen
Posted in Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/11/27
As of Visual Studio 2010 SP1 (I think it was there in the original non-SP1 version of VS2010), Microsoft has hidden the addition of classic ASCX webservices as they favour WCF over ASPX (there are quite a few differences).
It is easy to workaround though as Stack Overflow users User Cyberherbalist and User Alejandro Martin have shown, with a little bit post-editing from me: Read the rest of this entry »
Posted in .NET, .NET 4.0, .NET 4.5, ASP.NET, C#, C# 4.0, C# 5.0, Development, SOAP/WebServices, Software Development, Visual Studio 11, Visual Studio 2010, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2013/11/26
Sometimes a naming convention has been in place for quite a while, then new functionality breaks it.
One of the naming conventions in the JVCL is that all Delphi design-time packages follow the naming pattern *Design##.bpl
Until a package with run-time design functionality came along named (for Delphi XE3) as JvRuntimeDesign170.bpl. The actual design-time package for that is JvRuntimeDesignDesign170.bpl (:
I guess some of the reporting tools bumped into the same thing when they added run-time design support as well.
–jeroen
Posted in Delphi, Delphi XE3, Development, Software Development | 4 Comments »