Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Donate Bitcoins

Programming and Learning from SD June 2013 Entries
A co-worker (Scott) sent out this email and it was so good I asked him if I could share it with all of you. I changed the latitude and longitude to random locations to protect the innocent. “Stumbled across this method this morning while coding all the math out by hand to calculate distances. This one is definitely worth filing away for future reference, saved me a ton of work. This was added in v4 of the framework, and is in the core framework install, so should work in services as well as client ......

Posted On Wednesday, June 26, 2013 11:30 AM

Quick Hint: Formatting JSON for Debugging
I needed a way to quickly format JSON that I copied from the Network view in Google Chrome Developer Tools. A co-worker pointed me to the Notepad++ (or use Chocolatey to install Notepad++) plugin JSMin. Now all I have to do is copy the JSON into Notepad++ and Alt + Ctrl + M and I can see it easily.Update: is a great online tool. It has a nice visualizing tree view as well ......

Posted On Tuesday, June 25, 2013 11:08 AM

ASP.Net 4.5 Garbage Collection Improvement
I just read Five Great .NET Framework 4.5 Features on CodeProject by Shivprasad koirala. Feature 5 in his article mentions the GC background cleanup and has a good explanation of the work the GC has to do for ASP.Net on the server. “Garbage collector is one real heavy task in a .NET application. And it becomes heavier when it is an ASP.NET application. ASP.NET applications run on the server and a lot of clients send requests to the server thus creating loads of objects, making the GC really work ......

Posted On Monday, June 24, 2013 1:06 PM

When to set ws2007FederationHttpBinding establishSecurityContext to false
Turning the establishSecurityContext off (it’s on by default) was recommended in the IAC course on Pluralsight by Dominick Baier in the Security Best Practices module, State Management when making lots of short calls. “Other protocols like the WS 2007 Federation HttpBinding, they support state and unfortunately it’s turned on by default…. [uses] WS-Secure Conversation which is kind of heavy handed. It is quite complex as well and it has some performance implications.” ~ Pluralsight video ......

Posted On Wednesday, June 12, 2013 11:26 AM

Getting Started with Behavior Driven Development
In this post, I wanted to share some thoughts and resources that I’ve collected since learning about Behavior Driven Development (BDD) (as of June 2013). Thinking in BDD terms has really helped me in improving my software development and thinking through problems. I remember a day when it clicked. It was an exciting time for me and I don’t planning on going back to the old approach. My tendency is to dive into the code before thinking through things and that gets me into trouble. I’m also an optimistic ......

Posted On Tuesday, June 11, 2013 10:18 AM

Securing WebAPI and stopping CSRF requests
I just read this article in the June MSDN magazine by Peter Vogel and thought it needed to be highlighted. If you're using WebAPI you should think about Cross-Site Request Forgeries. It also applies to the 70-487 test. "ASP.NET doesn’t automatically protect you against Cross-Site Request Forgery (CSRF/XSRF) attacks (more on that later)." "When a user accesses an ASP.NET site using Forms Authentication, ASP.NET generates a cookie that stipulates the user is authenticated. The browser will continue ......

Posted On Monday, June 10, 2013 10:43 AM

Faking the WebApi User
I needed to unit test a WebAPI call in my MVC 4 application that checks the user's role. I'm doing this in my MVC controllers with the following code using FakeItEasy (I should do a post on that sometime): this.UserPrincipalFake = A.Fake<IPrincipal>(); A.CallTo(() => this.UserPrincipalFake.Iden... A.CallTo(() => this.UserPrincipalFake.Iden... this.HttpContextBaseFake = A.Fake<HttpContextBase&g... this.HttpContextBaseFake.User ......

Posted On Wednesday, June 5, 2013 10:29 AM

Copyright © Aligned | Powered by: