Quatro De Mayo

So, here I was, minding my own business, daydreaming about my vacation in a week, and I suddenly realized that a holiday was upon me!

I have but meager hours to stock up on Corona and lime before the grocery stores turns up their hands like the little Monopoly guy on the bankrupt card and I go wailing out the door in search of limes (because who could EVER run out of Corona?).

I have always loved Mexican food, (though, sadly, not always the mexicans), but have never really understood what it was that we all get slobbery drunk for on the 5th of May (other than for the chance of getting flashed by some poor drunk girl who thinks it is Mardi Gras).

Well, a little research turned up this:

“The holiday of Cinco De Mayo, The 5th Of May, commemorates the victory of the Mexican militia over the French army at The Battle Of Puebla in 1862. It is primarily a regional holiday celebrated in the Mexican state capital city of Puebla and throughout the state of Puebla, with some recognition in other parts of the Mexico, and especially in U.S. cities with a significant Mexican population. It is not, as many people think, Mexico’s Independence Day, which is actually September 16.”

So… what is it? Well, reading on I found:

“Cinco de Mayo honors the bravery and victory of General Zaragoza’s small, outnumbered militia at the Battle of Puebla in 1862.”

Ahhhhh… There we go.  So, much like the Irish, we drink to brave men who fought and died for something they believe in.

works for me.

SQL to XML

I recently got asked if there was an easy way to take data from SQL Server and export it to XML.

Well, turns out, the good people over at Microsoft made this VERY easy.

Take your query that you want to export to XML, for our purposes, let’s use:

SELECT TOP 1 * FROM ORDERS INNER JOIN CUSTOMERS ON ORDERS.CUSTOMERID = CUSTOMERS.CUSTOMERID INNER JOIN EMPLOYEES ON ORDERS.EMPLOYEEID = EMPLOYEES.EMPLOYEEID

and add FOR XML AUTO to the end of it. (oversimplification for some scenarios, but since this is a simple look at things, I am not going to dive into all that is possible. For that google FOR XML EXPLICIT. )That will return you some Nicely formatted XML with each of the columns as an attribute and each row as an element.

… but say you didn’t want that…
… say you wanted each column to be its own element.

Then just add FOR XML AUTO, ELEMENTS onto the end of things.

SELECT TOP 1 * FROM ORDERS INNER JOIN CUSTOMERS ON ORDERS.CUSTOMERID = CUSTOMERS.CUSTOMERID INNER JOIN EMPLOYEES ON ORDERS.EMPLOYEEID = EMPLOYEES.EMPLOYEEID FOR XML AUTO, ELEMENTS

This will render:

<ORDERS> 
    <OrderID>10258</OrderID> 
    <CustomerID>ERNSH</CustomerID> 
    <EmployeeID>1</EmployeeID> 
    <OrderDate>1996-07-17T00:00:00</OrderDate> 
    <RequiredDate>1996-08-14T00:00:00</RequiredDate> 
    <ShippedDate>1996-07-23T00:00:00</ShippedDate> 
    <ShipVia>1</ShipVia> 
    <Freight>140.5100</Freight> 
    <ShipName>Ernst Handel</ShipName> 
    <ShipAddress>Kirchgasse 6</ShipAddress> 
    <ShipCity>Graz</ShipCity> 
    <ShipPostalCode>8010</ShipPostalCode> 
    <ShipCountry>Austria</ShipCountry> 
    <CUSTOMERS> 
        <CustomerID>ERNSH</CustomerID> 
        <CompanyName>Ernst Handel</CompanyName> 
        <ContactName>Roland Mendel</ContactName> 
        <ContactTitle>Sales Manager</ContactTitle> 
        <Address>Kirchgasse 6</Address> 
        <City>Graz</City> 
        <PostalCode>8010</PostalCode> 
        <Country>Austria</Country> 
        <Phone>7675-3425</Phone> 
        <Fax>7675-3426</Fax> 
        <EMPLOYEES> 
            <EmployeeID>1</EmployeeID> 
            <LastName>Davolio</LastName> 
            <FirstName>Nancy</FirstName> 
            <Title>Sales Representative</Title> 
            <TitleOfCourtesy>Ms.</TitleOfCourtesy> 
            <BirthDate>1948-12-08T00:00:00</BirthDate> 
            <HireDate>1992-05-01T00:00:00</HireDate> 
            <Address> 507 - 20th Ave. E. Apt. 2A </Address> 
            <City>Seattle</City> 
            <Region>WA</Region> 
            <PostalCode>98122</PostalCode> 
            <Country>USA</Country> 
            <HomePhone>(206) 555-9857</HomePhone> 
            <Extension>5467</Extension> 
            <Photo>dbobject/EMPLOYEES[@EmployeeID='1']/@Photo</Photo> 
            <Notes>Education includes a BA in psychology from Colorado...</Notes>
            <ReportsTo>2</ReportsTo> 
            <PhotoPath>http://accweb/emmployees/davolio.bmp</PhotoPath> 
        </EMPLOYEES> 
    </CUSTOMERS> 
</ORDERS>

A nice nested output
Hope this helps some of you with your SQL XML needs.

RSS'r'US

I must admit, I have fallen prey to the RSS News Aggregator Phenomenon (is it still a Phenomenon anymore? or has it just become completely mainstream?  regardless).   So, you can imagine my frustration when I am out browsing the internet like it was 1999 and come across a really good blog… that does NOT sport a handy dandy feed.  CURSES!

However, PonyFish to the rescue!

Ponyfish is a FREE web-based tool that allows you to create your own RSS feeds from almost any web page.

All you have to do is simply point Ponyfish to the web page you want to create a feed from, then follow a few steps to setup which types of links you want to include in the feed.

Very very cool stuff.  So, if you suffer from a distinct lack of RSS on some of your favorite site, head on over and check it out.

.Net vs Cold Fusion

This is in a response to John Bland’s Blog on the same topic. I was going to just post a comment, but I too got a little long winded.

I agree that you can’t compare .Net and CF, and in fact, you may be right that CF is easier to use on the web.

However, I still maintain that ASP.Net is a more powerful web tool than CF is. The first thing I need to point out is that you no longer need to compile ASP.Net code, that is taken care of automatically in v2.0, so it really only has one strike against it… you have to know the backend language. This is where I am going to get biased. CF is a scripting language, a very powerful one, but still a scripting language. I grant you that you can extend the capability of CF using Java that you can integrate into CF quite seamlessly, but on the same token, if you are going to code java… why not code C#? That is a more adequate comparison seeing that you have to use Java/CF to have all the ability that ASP.Net/.Net provide in a much more seamless package (even though as I already mentioned CF and Java get along quite nicely… they are still however two seperate models). .Net however IS enterprise level. The main advantage that CF/Java maintain over .Net (although, thanks to the Mono project, not for long) is that they run across platforms where .Net is limited to Windows.

There are MANY cases where if it was put to you to build a site in CF and build a site in ASP.Net, and depending on the complexity of the requirements, that you could get the job done faster with CF. However, for a very complex application, ASP.Net is going to be (in my opinion) by far the better choice because it is has more high level capabilities out of the box, where CF would need to be extended or do things in a manner that would not be considered “Good Coding”.

I grant that I am biased toward .Net, and I will stand up equally for anyone who says that Cold Fusion is a bad language, it isn’t. However, comparing it to ASP.Net is akin to comparing a Windows to a Mac to (pure)Unix. Sure, they can both perform the same tasks, but each one is better at a given task than the other. Where one excels and the other gets by, the situation could be reversed in a different circumstance.

So, which is better? I would say it depends on your project, both are powerful languages, but .Net is more far reaching in terms of overall capability.

Which would I use? Why, .Net of course.

Just don’t talk to me about PHP.

Now that's HOT

Scientists have produced superheated gas exceeding temperatures of 2 billion degrees Kelvin, or 3.6 billion degrees Fahrenheit.

This is hotter than the interior of our Sun, which is about 15 million degrees Kelvin, and also hotter than any previous temperature ever achieved on Earth, they say.

Now this is great and all… but the next sentence reads…

They don’t know how they did it.

I don’t know about you, but this disturbs me more than a little.  I mean, think about this for a second.  A group of (American) scientists get together in a lab… start fooling around, and make a gas that is orders of magnitude hotter than a THERMONUCLEAR EXPLOSION!   Not believing what they saw, and still not knowing HOW they did this… they do it again just be sure that the equipment didn’t malfunction.  So, you make a superheated gas hotter than anything else previously on record… something that could literally vaporize anything it touches, something that I would call a very lethal substance, and rather than counting yourselves lucky that your containment system didn’t vaporize along with the rods that made the gas in the first place… you put more in and do it again!

And people think that the southern rednecks are stupid.

You know that one of those lab techs said, “COOL! Let’s do it again!

This is hotter than the sun here people. This wasn’t something that was just solid and hot… no, this was a superheated GAS.

I wonder if other countries have lab geeks that do this kind of stuff?

Click here to read the full article