Archive for the ‘.NET’ Category
Posted by jpluimers on 2014/08/20
Depending on how you organize locks (for instance via waiting on semaphores or mutexes or spinlocks), deadlocks can become livelocks:
Inability to make forward progress because of conflicting spinlocks is usually referred to as ‘livelock’.
Thanks to Martin James for reminding me of that and Danny Thorpe for describing different ways of locking.
Be sure to read on deadlock prevention as well.
–jeroen
via: c++ – Do deadlocks cause high CPU utilization? – Stack Overflow.
Posted in .NET, C++, Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/08/14
Posted in .NET, .NET 4.5, C#, C# 4.0, C# 5.0, C# 6 (Roslyn), Cloud Development, Development, Software Development, Visual Studio 2013, Visual Studio 2014, Visual Studio and tools, Windows Azure | Leave a Comment »
Posted by jpluimers on 2014/07/10
In case I need to export DocX in .NET again: DocX – Home which is also at github.com/WordDocX/DocX
(I did it both with Word Automation and OOXML, they were a pain).
–jeroen
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Office, Office 2007, Office 2010, Office 2013, Office PIA, Software Development | Leave a Comment »
Posted by jpluimers on 2014/07/03
I’ve done quite a bit of VB.NET maintenance lately.
Most of that code was riddled with CType, both for conversions and casts. Quite a bit code had Option Explicit and Option Strict Off. A lot of those CType constructions had empty Try / Catch / End Try blocks around them.
Those empty catch blocks are a code smell. They pretend to be able to survive any exceptional disaster, but in practice you can’t. You have to indicate what kinds of disasters you can handle, for instance if a meteorite hits your data center (thanks George Stocker).
Turning off Option Strict can be OK under many circumstances (the default is off), but having Option Explicit off is usually a code smell as well, just like On Error Resume Next (which was also in plenty of the source code).
I do understand a lot of VB.NET source comes from people having programmed in VB 6, VBScript or VBA for a long time where those constructs were more common. But writing code in the 21st century is much more about writing code that you can prove to be right. Having proper error handling and compiler type checking is a big part of that.
It pays to go with the idiom, for example read the good and bad ways of vb.net – Safest way to check for integer.
Back to CType: basically you have do distinguish between conversions and casts. The reason is that when you know it will be a form of cast, CType is way to expensive. And if you know you will be doing conversions, than casting is not what you want.
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Development, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »
Posted by jpluimers on 2014/07/02
I only need it every once in a while, so finding the right links and tips to help me usually takes too much time.
So here is a small list to get started:
Keywords: CLR, SOS.DLL, WinDbg, mscordacwks.dll, PSSCOR4
Some tips: Read the rest of this entry »
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, Debugging, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/06/26
Interesting: about a year and a half ago, the Nikon SDK C# wrapper project started ad sourceforge.
Basically, it allows you to integrate the operation of your Nikon DSLR into your .NET projects.
It has some very interesting features:
- Control your Nikon DSLR via USB
- Capture Jpeg and Raw images directly to system memory
- Receive ‘Live View’ images
- Record Video
- Query and change camera settings (Exposure, Aperture, ISO, etc.)
- And much more…
Downloads: Nikon SDK C# Wrapper – Browse Files at SourceForge.net.
–jeroen
via: Nikon SDK C# Wrapper | Free Security & Utilities software downloads at SourceForge.net.
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/06/10
Wow, it seems I’ve been living under a stond since early 2011: the first StudioShell checkin.
[WayBack] StudioShell opens marvellous possibilities in Visual Studio 2010, 2012 and up.
Just look at the feature list: Read the rest of this entry »
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2014/05/15
Boy, was this Visual Studio .NET 2003 stuff a long time ago.
Bumped into this one:
---------------------------
Microsoft Development Environment
---------------------------
Visual Studio cannot start debugging because the debug target 'C:\develop\VS-2003\VS-2003-BASE\Source\AppTest\bin\Debug\AppTest.exe' is missing. Please build the project and retry.
---------------------------
OK
---------------------------
Indeed, Visual Studio was right: it didn’t understand the Release build existed like Visual Studio 2005 and up does:
C:\develop\VS-2003\VS-2003-BASE\Source\AppTest\obj\Release\AppTest.exe
–jeroen
Posted in .NET, .NET 1.x, C#, C# 1.0, Development, Software Development, Visual Studio 2003, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2014/05/14
A while ago, I had to do some emergency fixing in Visual Studio .NET 2003 as – despite it is unsupported – a client was still using it.
By habit, I tried to rename a variable using the Ctrl+R+R shortcut for Refactor Rename. It didn’t work, and I was not surprised: this refactoring was introduced in Visual Studio 2005.
A while later, I started to notice that WordWrap was turned on in the code editor.
It took me a few minutes and a quick search to find out the two are related:
Visual studio 2003: ctrl+R+R is the shortcut to toggle WordWrap in the code editor.
Thanks Micah for answering that!
–jeroen
via How can I toggle word wrap in Visual Studio.NET? – Stack Overflow.
Posted in .NET, .NET 1.x, C#, C# 1.0, Development, Software Development, Visual Studio 2003, Visual Studio and tools | Leave a Comment »