Craig Thrall

Previous | Page 3 of 13 | Next

OS X and -mno-fused-madd

March 28, 2014, 12:43 a.m.

After upgrading to OS X 10.9 and LLVM 5.1, I've been fighting an error when compiling: err: clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] The fix is to run export CFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future in your shell to turn the error into a warning.

SQL Server Stored Proc Query Plans

Oct. 22, 2013, 8:03 a.m.

I had a stored proc that returned in a few seconds when run in SSMS, but kept running for 10-15min plus when executed from the context of a console app or web service. One of our DBAs showed me that forcing a recompile of the proc every time would fix the issue. The proc is using the BETWEEN keyword in a WHERE condition to return a range of rows. When SQL Server knows the parameter values at compile time, it can optimize the query plan. It turns out that creating dummy variables in the proc and setting them to the value of the parameters being passed in forces a partial compile. This is called parameter sniffing. Read the article below for more info. http://www.sommarskog.se/query-plan-mysteries.html

Upgrading TFS Build Templates for TFS 2012

Nov. 30, 2012, 11:47 a.m.

Be careful when testing your build templates when upgrading from TFS 2010 to TFS 2012. If there is an error in your modified template, it would appear that TFS (not sure if it's just the agent or the controller as well) caches the bad template. The only solution we've found is to restart the TFS build server.

Unit Testing ASP.NET MVC

Oct. 4, 2012, 6:22 p.m.

I wanted to be able to test an ASP.NET MVC Controller without requiring additional third-party references. One issue I had was stubbing out an instance of HttpContext. Here's how to do it: [TestInitialize] public void TestInit() { HttpContext.Current = new HttpContext( new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter())); HttpContext.Current.User = new GenericPrincipal( new GenericIdentity("username"), new string[0]); }

Passing Multiple Parameters to ASP.NET MVC

Sept. 17, 2012, 2:23 p.m.

I've been working on an ASP.NET MVC controller that would accept POST requests from a jQuery Mobile page. Everything worked fine when my controller took a single parameter, but once I added a second parameter, everything fell apart. This post saved me: http://erraticdev.blogspot.com/2010/12/sending-complex-json-objects-to-aspnet.html

Behave Test Framework and Imports

Aug. 13, 2012, 11:06 p.m.

I've been using the Behave test framework for Python (<http://packages.python.org/behave>), and it's great so far. The feature files are straightforward, and it has really been helping me find and fix bugs. The one thing that bit me last night was the fact that you can definitely have import/package collisions across your test steps. For example, if you have one file with steps in it that says "from timestamp import timestamp," and in another file you have "import timestamp" then later "timestamp.date.today()," the Python interpreter won't find that method, because it's using the timestamp class directly (which doesn't contain "date"). As long as you use consistent imports across your test steps, you'll be fine.

Windows 8 RC in VirtualBox on OS X

Aug. 1, 2012, 11:10 p.m.

Don't install the Guest Extensions. If you do, and they don't kill the video performance of your virtual instance, let me know what the secret is. It seemed to me like the VB graphics driver was doing all the graphics work in the CPU, as VirtualBox started using a ton of CPU and the performance of my Windows 8 instance was awful.

Debugging ASP.NET/Silverlight

June 16, 2012, 7:57 p.m.

I had a problem trying to debug some Silverlight code hosted in a ASP.NET application I was running locally. I had some environment-specific issues that I fixed by updating my machine.config file, but Visual Studio still wasn't hitting a breakpoint set in my Silverlight code. After making sure I had enabled Silverlight debugging in my web application properties, I tried stopping all the Sharepoint 2010 sites and services running on my laptop. That did it! I'm not sure why, the site I was trying to debug was running in a different application pool.

Debugging VS2010 on Local IIS

June 1, 2012, 11:36 a.m.

When you try to start a debug session on your local IIS instance from VS2010 and it complains about being unable to attach with a weird URL like http://localhost/foo/http://localhost/debugattach.aspx, right-click on a page in your web project and click "Set as Start Page."

More Thoughts on Android

Dec. 29, 2011, 11:55 a.m.

I took a trip up to Vermont this weekend. While Sprint coverage has not been as good as AT&T in Massachusetts, I had coverage for the whole trip up 89 through Vermont with my new Sprint Android phone while my AT&T iPhone had nothing. Every phone I had prior to the iPhone needed to be rebooted by swapping out the battery now and then. Since the iPhone is hermetically sealed, it's a good thing that I never had to do that. But Android is definitely flakier as an OS. I'm not sure if there were multiple transitions between coverage areas, or if the Republic Wireless changes are causing issues, but I had to pop the battery out of the RW phone a couple times during the trip. The RW phone has been pretty stable until then, which is why I think it was caused by coverage or something external.