NASA Asteroid Data Hunter TopCoder Challenge – World Coordinate System algorithm C# port

Posted by Marius D. on March 26, 2014  /   Posted in Uncategorized

As part of the NASA Asteroid Data Hunter TopCoder Challenge, we have had to deep dive into and learn a lot about astronomy.

The challenge exposes FITS (Flexible Image Transport System) data sets to the challenger. The FITS data set contains a number of World Coordinate System data points such as

  • Right Ascension
  • Declination
  • X,Y reference pixels
  • X,Y coordinate increments,
  • Rotation in degreen
  • Projection type (e.g. tan, sin, etc)
  • X,Y reference pixel coordinates , etc..

Using this information one can extrapolate RA(right ascension) and Declination of any pixel on an astronomical image. Inversely, one can map an RA/Dec value to a pixel.

Since we prefer to develop on the .NET platform we had a hard time finding any algorithms/libraries to help with this task. We ended up porting the WCSTools library, specifically for the pixel to RA/Dec algorithms, to C#/.NET

The source code can be found on our Google Code site: https://code.google.com/p/wcstools/


SQL Server 2005 & 2008 – Unable to start job (reason: syntax error)

Posted by Marius D. on April 16, 2010  /   Posted in Uncategorized

Error Message

Unable to start execution of step 1 (reason: line(1): Syntax error).  The step failed.

The Problem

SQL renames or re-saves the package job after editing causing the package location to be inaccessible.

The Solution

Append a backslash ‘\’ to the package name

1. Navigate to your job  (Database Server – >SQL Server Agent -> Jobs -> Your Job) and right click, choose properties

2. Click on steps in the job properties, choose the first step in the job step list, click edit below the job list.

3. Add a backslash ‘\’ to the package name and save


Tortoise SVN Global Ignore Pattern for Visual Studio 2008 w/ ReSharper

Posted by Marius D. on February 25, 2010  /   Posted in Uncategorized

Source/Version/Revision Control

How many times have you spent countless hours writing code just to realize you’ve either overwritten or accidentally deleted your files? How many times have you been working with a team of developers just to realize your coworker has overwritten your code?

This has unfortunately happened to the best of us at one point or another. This issue usually prompts us to look for a way to easily backup our code and share it between multiple developers. On our journey, we find many different flavors of source/revision control. Dependent upon your preference there are multiple options available, some free, some purchased. For more information on source control visit Wikipedia.

The Problem

For those of you that have chosen Tortoise SVN, a windows shell integrated CVS source control solution, you may find it unnecessary to save files or folders created by plug-ins and visual studio. These files can be very annoying as they usually change every time you open up your solution, or build your application. A popular plug-in for Visual Studio that creates extra files and folders is ReSharper. I will focus on removing the files created by this plug-in.

As you can see, ReSharper folders and files are available to add to the source control by default.

The Solution

In order to tell Tortoise SVN to ignore the files and folders created by ReSharper and to not list them every time we commit our files, we have to add the extensions/folders to Tortoise SVN’s global ignore pattern text box.

Ignore pattern to ignore ReSharper Created files:

**.ReSharper** **\_ReSharper.**

Ignore pattern to ignore Visual Studio Files which shouldn’t be source controlled:

*\bin* *\obj* *.suo *.user

Combined Ignore pattern to ignore both Visual Studio and ReSharper files:

*\bin* *\obj* *.suo *.user **.ReSharper** **\_ReSharper.**


Adding any of these “ignore” rules is simple. First identify the rule you want to add; I recommend the combined rule, and then:

1. Right click on any of your repositories, hover over TortoiseSVN menu option, and click on the Settings sub link.

2. Add the rule you have chosen to the global ignore pattern and remember to click “OK”.

That’s it! Now when you try to commit your changes, you won’t see any of those annoying extra files!


SQL Server 2008 Collation on Limited Security Accounts

Posted by Marius D. on February 25, 2010  /   Posted in Uncategorized

What is collation?

Collation is a set of rules that determine how data is stored and compared in SQL server. These rules define characteristics such as how data is sorted with the correct character sequence, case sensitivity specifications, how accent marks are treated, and character widths.

How can collation cause trouble in SQL Server Management Studio in a limited security environment?

By default, when you click the ‘Databases’ node within the SQL server management studio under the Object Explorer after connecting to a server, a list of databases on that server is enumerated and shown. In a shared environment, such as a hosted SQL server account solution, each log-in only has access to its own database. This means that collation information is only available for the database that the log-in has access to.

SQL server management studio, by default, tries to grab collation information for every database that is enumerated on the server. The trouble occurs when a database that has a collation other then the default is enumerated and the log-in used to enumerate the database does not have access to the collation information. This usually results in a complete error when opening the ‘Database’ node and prevents any databases from being shown.

The error usually states:
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
–> An exception occured while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
–> The server principay “login” is not able to access the database “db with non default collation” under the current security context. (Microsoft SQL Server, Error:916)

How can the problem be fixed?

The quickest way to mitigate this issue is to turn off database collation by default. To do this, follow the steps below, or check this out.

1. Click on the ‘Databases’ folder under the SQL server in the SQL Server Management Studio.

2. Press F7 or click the ‘View’ toolbar menu item then select ‘Object Explorer Details’

3. Right click the headers in the ‘Object Explorer Details’ data grid and deselect ‘Collation’

That’s it! If you try to re-enumerate the databases, the blocking operation will no longer be executed by default.

Happy Coding!

^ Back to Top
%d bloggers like this: