Windows 8 Phone Music Bug (Resolved)

I noticed that no matter how I synchronized my phone, the music would be organized properly, but within the hour all of the music data was wrong. I have never had a device that actually changed the music files. I find this absurd and presumptuous for a device to force unapproved, permanent information on your media. 

I finally found a setting under System Settings \ Applications \ Music + Video. Turn “Connect with Xbox Music” OFF. 

You will lose a few minor features, but your music will be safe.


Online IDE Actually Works

CodeRunThis is one of the coolest things I have seen in a long time, even if it isn’t practical for real development. It does lend itself well towards demos and snippet sharing, maybe even community development. It is an online IDE currently in beta that allows you to run projects like Visual Studio. Supports ASP.NET, PHP, jQuery, YUI, etc.
CodeRun


jQuery UI DatePicker Scrolls to Top After Select

I have been struggling with the jQuery UI DatePicker and almost started using an alternate one. If my grid causes the page to scroll down, and I open a dialog with a DatePicker on it, after I choose the date, the window would scroll to the top. I looked over the code for the DatePicker and nowhere are they setting the scroll position.

After banging my head I noticed that the date selector was simply an anchor tag with href=”#”, which defaults to the top of the document.

In the jQuery UI code I simply replaced all of the href=”#” with javascript: function() { return false };


Delete and Constraint Handling Stored Procedure Using SQL Server 2000

This is an older article I wrote on Code Project. The solution stems from a very unique problem I encountered when assigned to fix a WinForms application created by a nightmarish codegen. It deals with SQL Server 2000 and is probably no longer applicable, but definitely an interesting read. If anything it may inspire a WTF.

Here is an excerpt:

I was providing consulting services, developing an application in C# and .NET 2.0 with a SQL Server 2000 database. The application framework was based on a custom code-generator, which created SQL scripts, business objects, and UI code. Because the previous consultant who designed the code-generator was no longer available, time constraints restricted us from discovering and modifying the generator, leading me to take a different approach to my solutions.

In this article, I describe how I created the ability to perform deletes. The framework did not include proper scripts for cleaning up and deleting records, and for reasons beyond the discussion of this article, I chose to do all of the constraint checks and deletes from a stored procedure, and return an error message if any constraint violations would occur from a delete.

The solution actually involves permanently modifying master database and system level objects. When I wrote the article I may not have clearly stated the reason for the solution in the first place. SQL Server 2000 does not do well when trying to cascade delete a record that has an unimaginable number of restraints on very large tables. If you look at the master level stored procedure, it actually checks the constraints, lets the delete process throw the error anyway. This results in very slow deletes. In this case it could take up to a minute to return an error. The solution is actually an aim to rewrite those stored procedures to behave correctly. I wouldn’t recommend it. I would never do it again. But in this case, I had no choice. Here is the article for a full implementation:

http://www.codeproject.com/KB/database/sql2kdeletesconstraints.aspx


Team Foundation Sidekicks: Command Line Killer

I’ve had great success using Team Foundation Sidekicks. If you are tired of using command line for tools that should already be in TFS, this is your goto free product.

http://www.attrice.info/cm/tfs/


Using DiffMerge with Visual Studio

I won’t take credit for this, but it is necessary if you ask me. The TFS merge tool is awful. I am posting the link below for the credit.

http://statestreetgang.net/post/2008/01/Using-DiffMerge-with-Visual-Studio-and-Team-Foundation-Server-client.aspx

Go to Tools, Options, Source Control, Visual Studio Team Foundation Server, Configure User Tools, and Add.

From there it is pretty intuitive.

Important excerpt:

The above just shows the simple configuration for comparing files.  It doesn’t show how to configure DiffMerge as your merge tool.

First, the above arguments work, however the documentation says to use the following arguments when setting up DiffMerge for comparing:  /t1=%6 /t2=%7 %1 %2

To configure for merge, Add a new setting (step 3), repeat step 4, select Merge in Operation, repeat step 5, and use the following command line:  /m /r=%4 /t1=%7 /t2=%8 /t3=%6 /c=%9 %2 %3 %1


Color Sorting in jQuery jqGrid

I am developing a project management application. One of the requirements is to implement project state colors (red, yellow, green) and be able to sort by them in grids. In my case this is client sorting. To accomplish this without any custom sorting functions this is what I did.

I put the name of the color as the value of the cell. I wrapped the value in a div with a specific style using a custom formatter. The style sets the background-color and the color to the same color to hide the text, and I go an extra step and set the text-indent to -1000 and set overflow to hidden. Voila! jqGrid uses the color to sort.

Here is the example:

._pv-pstat-green
{
    color: #87D27E;
    background-color: #87D27E;
    width: 100%;
    overflow: hidden;    
    text-indent: -1000px;
}
formatter: function(cellvalue, options, rowObject) {
     return "<div class="_pv-pstat-&quot; + cellvalue.toLowerCase() + &quot;">" + cellvalue + "</div>";
}