Upgrade TeamCity 5.* to TeamCity 7.*

Recently I moved and upgraded my build server to a new server and a new version. At first, this task looked not obvious without manuals and guidelines. But I found this article http://paulstack.co.uk/blog/post/Upgrading-from-TeamCity-5x-to-60.aspx which helped me a lot and I was able to migrate smoothly

Posted in TeamCity | 1 Comment

Create an instance with an internal constructor without using ‘new’

It was a surprise for me that Activator.CreateInstance does not create an instance using an internal constructor when its class is declared in another assembly and marked with InternalsVisibleToAttribute pointed to a calling assembly. I’m not sure does it work in the same assembly, didn’t check. But there is a simple solution using reflection. Here is is an example:

typeof(Foo).InvokeMember(null, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
Posted in .NET, C# | Leave a comment

jquery.bgiframe and IE9 (Win7)

There is a bug in jquery.bgiframe of versions before 2.1.2. The bug occurs in IE9 on Win7. The cause is slightly incorrect regex pattern to test with a user agent string which indicates that this is IE6. The pattern looks only for occurrence of ‘6.0’. But this is misleading because IE9 browsers may have 6.0 sub-string for some other features of their system.

The correct version of the plugin starts from 2.1.2. The pattern was changed there to ‘msie 6.0’. And that is more accurate mark.

Posted in Javascript, jQuery | Leave a comment

Text data type can not be ordered or unioned

It was astonished for me that databases like MS SQL and Sybase do not support ordering and union by columns of the TEXT type (and some other data types, in short big data blobs). It seems the reason is logical. I would suppose it is performance hit to compare such big data sets that could be stored in such columns. So when you change legacy data type to text be sure that somewhere else this column is not a part of such operations. Or you will caught unpleasant regression as I did.

Posted in Microsoft SQL Server, Sybase | Leave a comment

Unary Negative in MS SQL

Occurred that  MS SQL also is not so perfect. Recently I was pointed to rsdn.ru where was shown a mathematical feature of the MS SQL:

ref A. SELECT 20.0 / -2.0 / 5.0 * 3.0 results into -16.666666

ref B. SELECT 20.0/ (-2.0) / 5.0 * 3.0 results into -6.00000

From my point of view (and I hope from math point also) both of results should be -6. But MS SQL recognizes “-” (minus) as a unary operator with higher priority. It executes from -2 until the end and then divides 20 with a calculated result:

ref A. 20 / ( -2 / 5 * 3)

ref B. 20 / -2 / 5 /3
Posted in Microsoft SQL Server | Leave a comment