Archive for the ‘Delphi’ Category
Posted by jpluimers on 2010/05/25
Having done quite a bit of C and C++ work in the past, I often still use “Yoda Conditions”, especially in environments where you have both = and == as an operator.
So, in a boolean expression, I often put the constant to test in front of the test.
I recently learned at stackoverflow that quite a few people call these “Yoda Conditions”:
“Yoda Conditions”— the act of using if(constant == variable) instead of if(variable == constant), like if(4 == foo). Because it’s like saying “if blue is the sky” or “if tall is the man”.
Thanks to dreamlax for helping me find that.
This is a problem in languages that have both the = and == operators, and the result of an assignment itself is also a value (i.e. allowing a = b = true). Read the rest of this entry »
Posted in .NET, C#, Delphi, Development, Java, Ruby, Software Development, Web Development | 22 Comments »
Posted by jpluimers on 2010/05/21
Scott Dorman udpated his macro to change the target framework version for all projects in a solution to Visual Studio 2010 and published the new macro on CodeProject.
His new macro now supports these target frameworks:
Notes:
- The links are to the download pages of the frameworks; look for “Standalone version” or “Full installer” for non-bootstrap download.
(version 1.1 can be downloaded here, but is not supported in VS2010)
- The “Client Profile” versions are stripped down versions of their “Full” counterpart.
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Delphi, Development, Prism, Software Development, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2010/05/14
I always tend to recompile assemblies when something changes they depend upon.
But now I’m even more careful after reading Fabulous Adventures In Coding : Putting a base in the middle.
Especially his checklist is important.
When you use a newer version of an assembly you depend on:
(1) at the very least test your derived types with the new base type — your derived types are relying on the mechanisms of the base types; when a mechanism changes, you have to re-test the code which relies upon that mechanism.
(2) if there was a breaking change, recompile, re-test and re-ship the derived type. And
(3) you might be surprised by what is a breaking change; adding a new override can potentially be a breaking change in some rare cases.
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Delphi, Development, Prism, Software Development | Leave a Comment »
Posted by jpluimers on 2010/05/12
A short while ago, [WayBack] Danny Thorpe posted an answer about multithreading issues on StackOverflow.com [WayBack] which reminded me a lot about a BorCon session he did.
That session is called [WayBack] “Reading Tea Leaves: The Fine Art of Debugging“, it is still very current (a lot of it is not Delphi specific at all: it can be applied to a broad range of platforms), and I was glad to find that [WayBack] Joe White made [WayBack] some great notes and posted them on his blog.
Edit 20100513T0830: (thanks Mario!) Don’t you love 404 :-)
The blog from Joe White seem to be down, and the web archive of his blog didn’t have that particular page, but the google cache has.
–jeroen
PS:
Danny is a great writer; I’m really glad he [WayBack] showed up at StackOverflow.
Here is another very [WayBack] nice answer from him on concurrency in software using read-write, locking, interlocked increment and more.
He found back his slides:
Consolidating a dusty box of ancient DVDRW archive disks this weekend (uploading them to multi-redundant NAS) and looky what I found! I’d given up all hope of ever finding this again. #digitalpackrat ftw!
Hope this brightens your day @jpluimers :) https://t.co/saqq7JA46e
Posted in Debugging, Delphi, Development, Software Development | 3 Comments »
Posted by jpluimers on 2010/05/11
This Why does this code fail in D2010, but not D7 question on stackoverflow once again shows that SizeOf on character arrays usualy is evil.
My point in this posting is that you should always try to write code that is semantically correct.
By writing semantically correct code, you have a much better chance of surviving a major change like a Unicode port.
The code below is semantically wrong: it worked in Delphi 7 by accident, not by design:
Like many Windows API functions, GetTempPath expects the first parameter (called nBufferLength) number of characters, not the number of bytes. Read the rest of this entry »
Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Development, Encoding, ISO-8859, Software Development, Unicode | Leave a Comment »
Posted by jpluimers on 2010/04/29
After the excitement of .NET 4.0 and all the tools around it, I totally forgot to mention that SQL Server 2008 R2 got to RTM.
If you are an MSDN subscriber you can download it there.
If you are not, you can download the Microsoft SQL Server 2008 R2 RTM – Express with Management Tools.
Brent Ozar wrote a pretty nice FAQ on the new SQL Server 2008 R2 features, much better than the “what’s new” and press release by Microsoft.
Feature conclusion so far:
- nice new stuff for Business Intelligence
- no new stuff on the engine and T-SQL front
- watch your licensing when doing virtualization; the non-R2 is far cheaper for that
–jeroen (who just turned 41 today)
Posted in .NET, Database Development, Delphi, Development, Software Development, SQL Server | 2 Comments »
Posted by jpluimers on 2010/04/28
The Microsoft patterns & practices Developer Center released the Microsoft Enterprise Library 5.0 last week.
This version of the Enterprise Library has a ton of new features, and now has full support for .NET 4.0 and Visual Studio 2010.
Next to using it from C#/VB.NET, I’m looking forward to see how well this can be used from the upcoming Delphi Prism 2011 release (scheduled to be released on May 15th).
Lots of stuff to experiment with :-)
–jeroen
Posted in .NET, C# 4.0, Delphi, Development, Prism, Software Development | Leave a Comment »
Posted by jpluimers on 2010/04/27
If you have a TechNet or MSDN account, you can download the SharePoint, Office, Visio and Project 2010 RTM builds.
Downloads have become available on April 23rd.
The SharePoint designer is available from the Microsoft Download centre as William Conrwill describes at CodeJedi.NET : SharePoint, Office, Visio and Project 2010 RTM are now available on MSDN.
If you have SA, then as of today (April 27), you can get your volume licenses as well.
William describes more dates in his post Office, SharePoint, Project and Visio 2010 have made RTM!
I’ll be busy playing with all the bits from Delphi and .NET API perspective :-)
–jeroen
Posted in .NET, Delphi, Development, Power User, Prism, Software Development | Leave a Comment »
Posted by jpluimers on 2010/04/22
I usually pick a fresh VM for installing an RTM build, but if you have loads of stuff on your (physical) machine, upgrading RC to RTM can be a real time saver.
Stack Overflow has a nice question Upgrading Visual Studio 2010 RC to RTM answered by Danny Thorpe (yes, two links: blog / wikipedia).
The order is really imporant, so lets repeat that here:
- Uninstall all the VS 2010 parts
- Uninstall the .NET Framework Multitarget package.
- Reboot
- Uninstall the .NET Framework client package
- Reboot
–jeroen
Posted in .NET, C#, C# 4.0, Delphi, Development, Prism, Software Development, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2010/04/20
A client recently asked me what space should reserve to store URLs in their DBMS.
The plurality in the topic title is a hint: different systems have different limits on URL lengths.
But first:
Don’t use long URLs
If you use long URL’s (longer than say a coupe of 100 characters), then usually you have a problem.
First of all: short URL’s are easier to remember, index and search.
Second: long URL’s can pose problems.
It might be that your browser and server support them.
But a user might be behind an intercepting proxy (sometimes invisible to both you and your user) that imposes a URL limit.
In stead of long URLs with a HTTP GET, use shorter URLs with a HTTP POST. Read the rest of this entry »
Posted in .NET, ASP.NET, Delphi, Development, Firefox, Internet Explorer, Opera, Safari, Web Browsers, Web Development | 8 Comments »