Archive for the ‘.NET’ Category
Posted by jpluimers on 2012/08/21
Every so often, I come across a pearl that I hand’t read before. This time I was looking for the source of “nothing is more permanent than a temporary solution”, and somehow came across the book 97 Things Every Programmer Should Know.
It is full of interesting concepts phrased in easy to read chapters on important things like “Code in the Languae of the Domain“, “Don’t Repeat Yourself” and many (95 <g>) others.
For a small introduction, read the PDF presentation extract, and the 97 things website.
–jeroen
via: 97 Things Every Programmer Should Know – Programmer 97-things.
Posted in .NET, Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2012/08/18
A question like How do you clear your MRU list in Visual Studio? is why I still like Stack Overflow.
The answers explain how to solve this in a version neutral way, including other MRU lists, and as a bonus point you to handy Visual Studio tools.
–jeroen
via: registry – How do you clear your MRU list in Visual Studio? – Stack Overflow.
Posted in Development, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2012/08/16
The .NET 4.5 beta has a bug that manifests itself as an AV or an FatalExecutionEngineError in certain circumstances of String.Empty handling, which is fixed by the .NET 4.5 RTM that shipped earlier this month followed by Visual Studio 2010 RTM today.
Eric Lippert on this:
Thanks both to the original poster for reporting it here, and to Michael for his excellent analysis.
My counterparts on the CLR tried to reproduce the bug here and discovered that it reproduces on the “Release Candidate” version of the 64 bit CLR, but not on the final “Released To Manufacturing” version, which had a number of bug fixes post-RC. (The RTM version will be available to the public on August 15th, 2012.)
They therefore believe this to be the same issue as the one that was reported here:
http://connect.microsoft.com/VisualStudio/feedback/details/737108/accessviolationexception-bug-in-net-4-5-beta
Many apologies for the error.
–jeroen
via: c# – What’s the cause of this strange bug? – Stack Overflow.
Posted in .NET, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2012/08/16
If anyone knows a better solution than string search/replace, please let me know:
I’m required to write a tool that can handle the below XML fragment that is not well formed as it contains XML declarations in the middle of the stream.
The company already has these kinds files in use for a long time, so there is no option to change the format.
There is no source code available that does the parsing, and the platform of choice for new tooling is .NET 4 or newer preferably with C#.
This is how the fragments look like: Read the rest of this entry »
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, C#, C# 2.0, C# 3.0, C# 4.0, Development, Software Development, XML, XML/XSD | Leave a Comment »
Posted by jpluimers on 2012/08/15
A few weeks ago, Bill Karwin did a must watch webinar on the prevention SQL Injection titled “SQL Injection Myths and Fallacies“.
Bill Karwin (twitter, new blog, old blog, Amazon) is famous for much work in the SQL database community, including InterBase/Firebird, mySQL, Oracle and many more.
He also:
Anyway, his webinar is awesome. Be sure to get the slides, watch the replay, and read the questions follow up.
Watching it you’ll get a better understanding of defending against SQL injection.
A few very valuable points he made: Read the rest of this entry »
Posted in .NET, .NET 3.5, .NET 4.5, .NET ORM, ASP.NET, Batch-Files, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Cloud Development, COBOL, CommandLine, Database Development, Delphi, Delphi for PHP, Delphi x64, Delphi XE2, Development, EF Entity Framework, F#, Firebird, FireMonkey, History, InterBase, iSeries, Java, JavaScript/ECMAScript, Jet OLE DB, LINQ, LLBLGen, MEF, Microsoft Surface, Mobile Development, PHP, PowerShell, Prism, Scripting, SharePoint, SilverLight, Software Development, SQL, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 7, VB.NET, VBS, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, Web Development, Windows Azure, WinForms, WPF, XAML, xCode/Mac/iPad/iPhone/iOS/cocoa | 1 Comment »
Posted by jpluimers on 2012/08/09
A while ago, I needed a way to defer settings to environment variables in a .NET application written in C#.
The easiest way to do this is to keep the same syntax as for expanding environment variables in batch files: use the %ENVIRONMENTVARIABLE% syntax (not the delayed expansion !ENVIRNMENTVARIABLE! syntax).
The reason is that there is a Windows API function ExpandEnvironmentStrings that handles all the expansion magic.
Don’t P/Invoke that function yourself, as there is already a very nice Environment.ExpandEnvironmentVariables wrapper since the .NET framework 1.1 that handles all the gory details for you (like marshalling the strings, making sure that lpDst contains enough space for the expansion).
–jeroen
Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2012/08/08
CodeRush has a nice refactoring to extract a C# string into a resource.
There is a small glitch that when you press undo after that, and there was no string file in your project, then the empty resource file is not always saved.
Upon building your project, you will get an error like this:
---------------------------
Microsoft Visual Studio
---------------------------
The item 'Resources.resx' does not exist in the project directory. It may have been moved, renamed or deleted.
---------------------------
OK
---------------------------
The Resources.resx file is not visible in your Solution Explorer, so you cannot delete it there.
You have to manually edit your .csproj file and remove the Resources.resx reference there.
I’ve had this happen only a couple of times, and cannot yet reproduce this. Until I can reproduce, this is a workaround to remedy the effects.
–jeroen
Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2012/08/02
Your CodeRush SolutionCache folder (which is in your roaming profile, how bad!) can grow to multi-gigabyte proportions as it is not auto-cleaned.
This can lead to very long times for doing logon/logoff in a corporate network.
Mike Christian describes how to clean it.
Note that as of a few versions ago, the AssemblyCache is now a subfolder inside the SolutionCache folder.
Another reason to clean it is when CodeRush starts acting weird.
–jeroen
via: The Curly Brace: How to Clear DevExpress CodeRush Assembly and Solution Cache.
Posted in .NET, C#, Development, Software Development, VB.NET, Visual Studio 11, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2012/08/01
Computing on not so common platforms it so much fun, especially when you can use familiar tools for it.
A couple of years ago, I did a fun project with an USB WebCam, a Pololu USB servo controller, two servo motors, a servo relay and a laser pointer. The device would point the laser pointer at the biggest moving object in the WebCam view, and flash the laser pointer at it.
All code was C# running on Windows.
Basically there are two classes on “small” devices that run .NET code (apart from smartphones and tablets):
- Raspberry Pi:
Mini devices with more than a couple of megabytes memory running a kind of regular .NET Framework.
- Arduino:
Micro devices with maximum of a couple of dozen kilobytes memory (a megabyte if you are really lucky) running the .NET Micro Framework
This might be a chance to lift it to a new level and embed everything in one device (:
The cool thing about the .NET Micro Framework is that you can do real time stuff.
–jeroen
via:
Posted in .NET, Arduino, Development, Hardware Development, Raspberry Pi, Software Development | 2 Comments »