A View Inside My Head

Jason's Random Thoughts of Interest
posts - 86, comments - 178, trackbacks - 22

.NET

Entity Framework Spatial: A Real World Example

Background From the Wikipedia article, Leadership in Energy and Environmental Design (LEED) is described as “an internationally recognized green building certification system, providing third-party verification that a building or community was designed and built using strategies intended to improve performance in metrics such as energy savings, water efficiency, CO2 emissions reduction, improved indoor environmental quality, and stewardship of resources and sensitivity to their impacts.” In my own words, LEED is a certification system that awards points for following certain environmentally-friendly practices when constructing a building. In the end, a building can be qualify for one of four different levels of certifications, based...

posted @ Wednesday, July 27, 2011 1:57 PM | Feedback (5) | Filed Under [ Articles .NET Spatial ]

Windows Azure platform AppFabric Access Control: Using the Token

In previous articles (Part 1, Part 2, Part 3), ACS was configured to process token requests from different Issuers, and a Customer application obtained a SWT token from ACS using an intermediate service (that represented its particular Issuer). Now that the application has a token, ACS is not needed again until that token expires. This article will show how to use that token in order for the Customer application to call the Bartender web service. Note: OAuth WRAP defines terminology for parts of the system as follows: The Customer application is known as the Client. The Bouncer (ACS)...

posted @ Saturday, March 27, 2010 3:46 PM | Feedback (0) | Filed Under [ .NET Azure ]

Windows Azure platform AppFabric Access Control: Introduction

The Windows Azure platform AppFabric Access Control service was one aspect of the Windows Azure platform that I found a bit challenging to understand, primarily because identity is not a domain that I regularly work with. This post, the first in a planned series of articles, will explore what the Access Control service is and why it is useful. Three Geeks Walk Into a Bar… Let’s examine a common real-world scenario: Ordering a drink from a bartender at a nightclub. Before the nightclub opens, the bouncers inform the bartenders about the token that customers will bear on that night to indicate...

posted @ Monday, March 08, 2010 11:37 PM | Feedback (0) | Filed Under [ Articles .NET Azure ]

You Need that Using Statement for Extension Methods!

I was working through some Windows Azure example code today, and came across a situation where IntelliSense did not show a method that the sample code used (CreateCloudBlobClient(), in this case): var storageAccount = Microsoft.WindowsAzure.CloudStorageAccount.FromConfigurationSetting("DataConnectionString");var blobStorage = storageAccount.CreateCloudBlobClient(); A lot of times, when I'm exploring an API, I will type out the fully qualified class name in code so that I can use IntelliSense to see what the other members exist in the same namespace. And, while I'm exploring, I usually don't bother to include a using statement at the top of my code because it's so easy to just use the...

posted @ Thursday, February 25, 2010 2:11 PM | Feedback (0) | Filed Under [ Articles .NET Azure ]

Microsoft Solver Foundation

Warning: Only 3 people who read this may actually understand it. This morning, after actually considering what the effort might be to port lp_solve from C over to .NET, I stumbled upon this: http://code.msdn.microsoft.com/solverfoundation About 4-5 years ago, I worked on a project that used a Frankenstein'ed "lp_solve 2.0-ported-to-Java-then-ported-to-C#" solver, which was great because it was free and it was a completely managed solution (no native components). What I was doing wasn't particularly that heavy of a problem, but still required a solver to quickly and reliably minimize a cost given a bunch of user-provided constraints. Solver Foundation appears to satisfy both of these "requirements"...

posted @ Saturday, April 04, 2009 7:53 AM | Feedback (0) | Filed Under [ .NET ]

Enterprise ASP.NET Application Performance Tip

Microsoft Regional Director (and friend) Steven Smith has a great talk about ASP.NET performance tips - I've seen the presentation probably a handful of times already, and always seem to walk away with something new to try that I didn't quite "grok" previously. But, here's one additional tip that I can offer that is easily overlooked, yet very important for enterprise development. Enterprise web applications (at least in my world) tend to use Integrated Security in order to provide Single Sign-On capability (i.e., automatically authenticating the user according to their Active Directory credentials). As such, Anonymous access to the web application is usually...

posted @ Monday, February 23, 2009 2:15 PM | Feedback (0) | Filed Under [ Articles .NET ]

Using SQL Server Spatial Objects as ADO.NET Parameter Values

I've previously mentioned that the SQL Server 2008 Spatial data types are freely available for use in your .NET applications, regardless of whether you have SQL Server 2008 or not. This allows you to incorporate some powerful spatial capabilities right into your application. (Look for "Microsoft SQL Server System CLR Types" on this page: http://www.microsoft.com/downloads/details.aspx?FamilyID=228DE03F-3B5A-428A-923F-58A033D316E1&displaylang=en ) However, in most usage scenarios, there will come a time when you have an instance of a SQL Server spatial object in your .NET application, and need to commit it to your SQL Server 2008 database. How would you do this, without losing fidelity or...

posted @ Thursday, December 11, 2008 2:04 PM | Feedback (0) | Filed Under [ Articles .NET SQL Spatial ]

SqlGeography: Ring Orientation of Polygon Interior Rings (Holes)

I have mentioned before how the Ring Orientation for the exterior ring of a Polygon is significant when instantiating a SqlGeography object. In this case, a Counter-Clockwise orientation is required so that as an observer walks along the path, the interior of the Polygon is always to their left. But, what I have never really seen documented (or paid attention to, at least) is the fact that the interior rings, or holes, of a Polygon also have specific Ring Orientation requirements. In keeping with the "Left-handed" rule, interior rings must be defined in a Clockwise manner - the opposite orientation of the...

posted @ Tuesday, November 25, 2008 9:14 AM | Feedback (3) | Filed Under [ Articles .NET SQL Spatial ]

Spatial: Determining Ring Orientation

A Ring is a list of points such that the starting point and ending point are the same (forming a closed shape). The order the you define the points that make up a Ring - known as Ring Orientation - is significant, for various data formats (including SQL Server's Geography type) imply special meaning for rings that are defined in a clockwise manner as opposed to a counter-clockwise manner. Given a list of points with no additional context, it can be difficult to determine the Ring Orientation being used. For example, suppose that you have a generic list of points that...

posted @ Monday, November 24, 2008 1:00 PM | Feedback (0) | Filed Under [ Articles .NET SQL Spatial ]

Upcoming Events

There are a few events taking place in October that I would like to promote: Day of .NET in Ann Arbor Saturday, October 18, 2008 The fourth Day of .NET in Ann Arbor event will take place on the campus of Washenaw Community College in Ann Arbor (or is it actually Ypsilanti? I can never tell). The original conference was a collaboration between GANG, AADND, and NWNUG. This year, we have officially added GLUG.net and West Michigan to the list of groups who are assisting in the organization and promotion. So, for those of you following along at home, this event is the product...

posted @ Thursday, September 25, 2008 12:50 PM | Feedback (0) | Filed Under [ Conferences .NET Me! ]

Help!

Dear Microsoft, We've been pals for a long time, right? You put out all of these great technologies, and I help others to use them within their own organization. We have a good thing going, you and me. But, I have a problem. You see, whenever I press this one special key on my keyboard, mostly by accident due to its proximity to ESC and ~, you give me an excuse to stop working and go get coffee. This isn't very productive. I don't always want an excuse to get coffee. Can you please add a Cancel button or something? Your modal dialog...

posted @ Monday, September 15, 2008 2:24 PM | Feedback (3) | Filed Under [ .NET ]

Announcing Tourniquet

Have you ever gotten an idea stuck in your head? One that you start your day thinking about in the shower, and then try as you might, you just can't get rid of it? That's what happened to me a few months ago. Specifically, I started thinking about Twitter, and the problems that it was experiencing. At that time, the "Fail Whale" was making very frequent appearances, indicating that Twitter was having problems keeping up with the demands being made on it. My Tweeps (social networking friends on Twitter), all with short attention spans like myself, began chattering about moving to...

posted @ Monday, August 18, 2008 12:16 AM | Feedback (0) | Filed Under [ Articles .NET ]

SQL Server 2008: Spatial Data, Part 8

In this, the eighth part in a series on the new Spatial Data types in SQL Server 2008, I'll step away from the database and do a little spatial coding using .NET. Redistributable .NET Library Up to this point in the series, I have demonstrated a lot of interesting (?) things that you can do with the new Spatial data types (Geometry and Geography) in SQL Server 2008. You might be thinking, "That's swell, and all, but I wish I could do some of that stuff without needing to be tethered to a database." Well, you know what? You can! I mentioned in...

posted @ Monday, June 23, 2008 10:18 PM | Feedback (20) | Filed Under [ Articles .NET SQL Spatial ]

Coding in SQL Server: An Evolution

Tuesday at the NWNUG meeting, Steven Smith spoke on various ways to squeeze performance out of your ASP.NET applications. This was a fantastic talk, and gave me plenty to think about (since ASP.NET is not my forte, I only consider myself to have an intermediate skillset on this topic). One suggestion that he made involved caching database writes. That is, instead of immediately writing logging-type information to the database for every request, which is a relatively expensive operation considering the small payload size, that you could accumulate them in a short-term cache, and then perform the write operation periodically. Fewer database...

posted @ Thursday, June 19, 2008 4:50 PM | Feedback (2) | Filed Under [ Articles .NET SQL ]

SQL Server 2008: Spatial Data, Part 7

The Open Geospatial Consortium's Simple Features specification, which SQL Server 2008's Geometry data type is based upon, defines standards for working with spatial data using a flat-earth (projected planar) model. Ironically, these standards don't exactly cover the intricacies of using an ellipsoidal model, which is needed to "accurately" represent the world that we live in. In other words, the OGC standards define how to work with paper maps of the world, but not globes. Fortunately, the SQL Server team recognized that that the Geometry type is inadequate for a lot of scenarios, and implemented a second data type just for representing...

posted @ Friday, May 16, 2008 10:53 PM | Feedback (6) | Filed Under [ Articles .NET SQL Spatial ]

SQL Server 2008: Spatial Data, Part 6

In the Part 4 and Part 5 of the series, I demonstrated some instance methods of the Geometry type that returned a new Geometry based on existing instances. In this part, I will concentrate on instance methods and properties of the Geometry type that return scalar values and Points. STArea, STLength Typically, your spatial data will represent something from the real world. A LineString may be the collection of points gathered from a GPS device, and together they may represent the path that you took from your home to the office. A Polygon may be the collection of points around the...

posted @ Friday, April 11, 2008 8:44 PM | Feedback (4) | Filed Under [ Articles .NET SQL Spatial ]

SQL Server 2008: Spatial Data, Part 5

In the previous part of this series, I demonstrated instance methods that transformed a single Geometry type into another useful Geometry. In this post, we'll go a step further and show methods that allow two or more instances to interact with one another in order to produce a new Geometry. For my baseline, I'll use two Polygons that overlap each other: DECLARE @g geometry = 'POLYGON((10 10, 40 10, 40 40, 10 40, 10 10))' DECLARE @h geometry = 'POLYGON((30 30, 50 30, 50 50, 30 50,...

posted @ Monday, April 07, 2008 11:51 AM | Feedback (3) | Filed Under [ Articles .NET SQL Spatial ]

SQL Server 2008: Spatial Data, Part 4

In this, the 4th post in a series (Part 1, Part 2, Part 3) on the new spatial data types in SQL Server 2008, I'll explain some of the methods that are used to transform a single Geometry instance into another useful Geometry instance. Note that I'm using Geometry for simplicity, but these techniques also work with Geography. Edit: Ok, after starting to take a hard look at Geography, I realized that A LOT of the methods that Geometry offers are not implemented in Geography. :-/ Sorry to mislead you. Useful TipTo help me to visualize geometries as I explore the...

posted @ Thursday, April 03, 2008 8:31 PM | Feedback (9) | Filed Under [ Articles .NET SQL Spatial ]

SQL Server 2008: Spatial Data, Part 3

In the previous parts of this series (Part 1, Part 2), I introduced the Geometry and Geography data types, the various subclasses (Point, LineString, Polygon, etc), and demonstrated a little bit of the Well-Known Text (WKT) syntax. These two posts were primarily informational in nature, and didn't touch SQL Server at all. Let's change that! Instantiating the UDT The Geometry and Geography data types are implemented as User Defined Types (UDT) written in .NET. They are automatically installed with the server, and are available for use by any SQL Server 2008 database. For this post, I will use the Geometry type to...

posted @ Friday, March 28, 2008 4:06 PM | Feedback (3) | Filed Under [ Articles .NET SQL Spatial ]

SQL Server 2008: Spatial Data, Part 2

In the first part of this series, I provided a somewhat verbose description of the two different types of Spatial data supported by SQL Server 2008: Geometry (flat Earth model) and Geography (ellipsoidal model). Now, let's dive in a bit deeper, and take a look at some of the specifics. Standards From their website, the Open Geospatial Consortium, Inc. (OGC) is described as "a non-profit, international, voluntary consensus standards organization that is leading the development of standards for geospatial and location based services." Unlike me, these folks are the real experts in the field who understand both the problems and the solutions...

posted @ Thursday, March 27, 2008 5:30 PM | Feedback (8) | Filed Under [ Articles .NET SQL Spatial ]

FANUG 3/25 Meeting

I was originally scheduled to present tomorrow (along with Greg Huber) at the Findlay Area .NET User Group. However, due to a cascading series of events, Greg and I will not be speaking in Findlay tomorrow. Instead, Dustin Campbell will be giving his fantastic Functional C# talk to the folks in his hometown. This presentation was originally scheduled for February, but bad weather on that date forced its cancellation. I'm very happy that Dustin was able to jump in and offer to do his presentation on such short notice. Since there was no NWNUG meeting this month, perhaps a few of our...

posted @ Monday, March 24, 2008 1:50 PM | Feedback (0) | Filed Under [ .NET Me! ]

SQL Server 2008: Spatial Data, Part 1

Beyond Relational The introduction of SQLCLR in SQL Server 2005 allowed for very rich User Defined Types to be utilized. This meant that a developer could create a single object that contained multiple data points (properties) and could also perform calculations internally (methods), yet store that instance in a single field of a single row in a database table. Suddenly, any type of data could be stored and queried in the database, instead of just strings and numbers. Fast forward to the present time, as Microsoft is celebrating the launch of SQL Server 2008 (notice that in the brilliance that is known...

posted @ Friday, March 14, 2008 5:13 PM | Feedback (12) | Filed Under [ Articles .NET SQL Spatial ]

Motivations?

Ok, the echo chamber response from yesterday's announcement is calming down, and now people are pointing out certain implications that the Microsoft Reference License brings to the table. Specifically, this clause of the License is generating a lot of noise: "Reference use" means use of the software within your company as a reference, in read only form, for the sole purposes of debugging your products, maintaining your products, or enhancing the interoperability of your products with the software, and specifically excludes the right to distribute the software outside of your company. Now, the typical GPL crowd is sure to introduce a lot...

posted @ Thursday, October 04, 2007 11:11 AM | Feedback (1) | Filed Under [ .NET ]

Reflector Just Became A Little Less Useful

Last night, I received a cryptic email from local DE Jennifer Marsman saying: "There is huge news coming…check ScottGu’s blog at noon tomorrow!" So, at noon, I checked. Nada. At 12:30, I checked again, and found this: http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx Way to go Microsoft! I mean, we basically have always been able to reflect the code to see how something works internally, but having nicely commented source code that can be stepped into at debug time is JUST FREAKIN' AWESOME!

posted @ Wednesday, October 03, 2007 12:53 PM | Feedback (0) | Filed Under [ .NET ]

Powered by: