Monday, July 27, 2020

T-SQL Tuesday #128: Learn From Others - July 2020

T-SQL TuesdayI don't write enough here. I let myself get too busy, and I often miss things that I want to write about. I have several articles that I've started and dropped and several ideas that I never even started. I do a great job of lurking and not a good enough job of participating when I should. So it's no surprise to me that I've been sitting on this post for a week and missed the deadline to officially participate. 

T-SQL Tuesday #128 for July 2020 was hosted by a friend of mine; someone I worked with a few years; and the person who is directly responsible for my transition from just a ColdFusion Programmer to also a SQL Developer (and now a DBA). 

When @AirborneGeek came to work with me, I was primarily a programmer who knew just enough SQL to literally be dangerous. I could get a query to return the data I wanted, no problems there. I had fallen into the normal trap of "My queries are slow. It's gotta be the database's fault." Or Network. But we all know the network is the cause of 99.9% of all problems, right? 

I think one of the primary reasons we even created his team was because we were an application running off of millions of records, with NO database experts, and our applications were slow. 

Specifically the reason why I became somewhat fascinated with SQL was because I ended up being responsible for an internal report that had to be run overnight because it ran for HOURS. I can't remember if I was the original author of said report or not (wouldn't be surprised), but it didn't really matter since it was my responsibility now. I thought it could do better, so I approached our new database team to see if they were smarter than me. Everyone knows that programmers are smarter than DBAs anyway, but I figured "What the heck?". I gave him my query. 

He held onto it for a couple of days, and when he handed it back to me, it looked nothing like what I had given him. But it gave me the same data and ran in only a few minutes! 

It may have been Voodoo, or it may have been Black Magic. Regardless, if not for my silly internal fault of always wanting to know "Why?", I'd be on a MUCH different career path.

Over the next couple of years, I had plenty of questions for him and the rest of the Database Team. The more I learned about how the database was supposed to work, the more I came to realize how wrong I had been doing things. That team taught me about how to do proper JOINing, proper indexing and generally how to make things faster and much more efficient. Also about how important it was to not accidentally write a Cartesian JOIN on a 10M row table.  ( Just FYI: That can apparently discover the memory limits of your SQL Server and earn you a desk visit from the DBA.) 

I know that my questions for @AirborneGeek probably seemed very basic to him. He always showed me patience when he answered my questions. He never treated me like an ignorant programmer, though in hindsight, I realize now how basic some of my questions must have seemed. So, What Can I Learn From Others?

As another pilot, I completely agree with the premise that piloting and DBAing have a LOT of similarities (disasters differ in magnitude, but are very similar in remediation, and a lot can be learned from other people's "Uh-oh" moments). 

My post really isn't so much about how I've learned to deal with SQL disasters, but about how I've learned to be grateful for the people who got me here. 

I can't say it enough, "Thank you, Kerry."



Though I guess I should also point out that the curiosity that was sparked has also led me to learn more about certain types of disaster remediation and recovery than I ever really wanted to know. So "Thanks again, Kerry."

Sunday, April 26, 2020

Come To Adobe ColdFusion Developer Week!

Just short and sweet... Adobe ColdFusion Developer Week is coming up. May 18-22, 2020. 

Hubble: A 30 Year "Failure"

Way back in the primitive days of post-WW2 America, astronomer Lyman Spitzer wrote a paper discussing the benefits of a space-based telescope. He spent the next couple of decades trying to convince anyone to help with the development of this telescope.

After many funding problems, a bunch of technical issues, an extreme delay caused by a Space Shuttle disaster (that traumatized almost half of U.S. school kids, including yours truly) and a sky-rocketing budget, on April 24, 1990, NASA finally launched the Hubble Space Telescope into orbit.

Hubble has had a somewhat difficult history. It was a very ambitious undertaking with a lot of moving parts that had to be precise to an extremely small degree. It had plenty of naysayers, and the cost overruns made it an easy target for jokes about NASA and budgets.

But the HST is an instrument that is going to significantly improve our abilities to look further into space than we've been able to, and we were going to get back some AMAZING pictures.

And then....

Credits: Left: E. Persson (Las Campanas Observatory, Chile)/Observatories of the Carnegie Institution of Washington; Right: NASA, ESA and STScI
Credits: Left: E. Persson (Las Campanas Observatory, Chile) /
Observatories of the Carnegie Institution of Washington;
Right: NASA, ESA and STScI
The initial results were quite a bit underwhelming. The jokes took on a whole new life, even prompting Jay Leno to joke that Hubble should be shot down and put out of its misery. The project was a bust. 

But fortunately, NASA has some pretty smart, persistent people working there. They realized that there was a problem with the mirror, and, since HST was designed to be manually serviced, they set out to do just that. It took a few space walks to get the mirror fully corrected, but after just the first fix in 1993, they got...

Credits: NASA
Spiral Galaxy M100 - Before/After 1st Fix
Credits: NASA
Hubble was working a lot better. 

In the ensuing years, Hubble has been upgraded and significantly improved. It has made over a million impressive observations, made numerous discoveries, significantly increased our knowledge of our universe, given us stunning images to look at and sparked an interest in space. Hubble is a pretty impressive redemption story and has become an unimaginable success. Not too shabby for a project that was only supposed to last for 3 years.

The James Webb Space Telescope has some pretty large shoes to fill. 

Happy 30th "Birthday", Hubble!


Hubble's Deployment
The Hubble Space Telescope, seen from the space shuttle 
Discovery during the observatory's deployment 
on April 25, 1990.   (Image: © NASA)

Jupiter Moon Transit, January 24, 2015
(Image credit: NASA/ESA/STScI)
Cosmic Reef
Hubble took this image, titled "Cosmic Reef," 
released April 24 to celebrate its 30th anniversary.  
(Image credit: NASA/ESA/STScI)

And a big THANK YOU to NASA, the ESA, the Goddard Space Flight Center and everyone else involved with Hubble.

Friday, April 17, 2020

Goodbye to an Old Friend

Today, I said goodbye to one of my oldest friends; a friend that has been with me for almost two decades.

This friend came along at the beginning of my software development career and has seen me through the many ups and downs of my path as a professional geek. When my youngest child was born, this friend was already there. Many years ago, this friend was destined for permanent retirement; thrown out like common refuse. Worthless. Headed for oblivion. But I saw value. I came to the rescue.

Home to home and half way across the state, this friend has followed me. It has been a rock and a comfort for me. I have battled many dangerous enemies with this friend. It has witnessed many of my adventures. This friend has helped me to face many challenges.

Sadly, it's time to say goodbye.

When I first found this friend, it was in a professional setting. Over the years, the friendship has moved to mostly leisure time.

The COVID-19 Quarantine has given me a chance to reconnect with this friend in a way that I haven't really experienced much in those ensuing 20 years. The last three weeks of Work-From-Home have given me the chance to spend a great deal of professional time with this friend, as opposed to the countless hours of fun and games this friend has been there for.

But the decision was made to move on before this craziness began. Commitments were made. Other companies were engaged to implement this split. I feel a little bad trading this friend in for a newer, younger model. But it had to be done.

My friend of 20 years will be leaving me today.

Old Friend
Goodbye, old friend.

I am frankly quite impressed that it has made it this long. Only ONE of its siblings survived this far, and that one met its end about 3 years ago. I wish I remembered the brand. I believe my brother and I purchased office furniture at Office Depot. We bought several of these chairs, and then a couple of Executive Chairs. All of them lasted MUCH longer than I ever expected them to. Whatever it was, it was a very impressive brand.

But, alas, it is time to move on.

New Friend
Hello, new friend.

I can only hope that this new chair is able to form the same long-lasting bond that the other one did. It's not as fancy as the old one was, but, so far, it's comfortable.

Time will tell.

Friday, March 13, 2020

What A Week!

Last Tuesday morning (March 3,2020), a little after midnight, my phone alerted me that there was a Tornado Warning in the area. I turned on the TV just in time to watch the News Channel 5 station get hit dead on by a tornado. ( and there's the Reporter's view ).

Shortly after that, it started raining pretty hard at my house, and the lightning flashed to a green sky. I knew it was coming our way.

I ran to get my wife out of bed and get downstairs with our son. We made it about halfway there before we lost electricity. The tornado touched down about a thousand feet from my house. It was over pretty quickly.

It was late, but my neighbors were out checking on each other. It was really too dark to see the full extent of the damage, but my block fared better than just a block over. Amazingly, I don't think anyone was seriously injured, but we did have a lot of downed trees and damaged houses.

We got electricity back yesterday.

Community response has been TREMENDOUS!

The day after the tornado hit, a friend of mine came over to help me cut up some trees. While we were doing that, another guy came up with his chainsaw to help cut. He didn't want money. He just wanted to help. Then we had volunteers from all over come into the area to help with cleanup. They finished cutting up my downed trees and hauled all of the stuff out to the street. All within just a few hours. The city has been coming by to haul off the debris.

Nashville Electric Service has put in a HEROIC effort and got our power back on.

My wife and I have been living out of hotels this week. I have some very good things to say about one, and some not so good things to say about another. When I get a chance this weekend, I'll post up some of the photos I took and videos I found, and I'll add a little more detail to my post.

There's still a lot of cleanup to do. The school my wife teaches at was severely damaged and classes had to be relocated. And there are other houses and areas of town with A LOT of damage still. A neighborhood just a few miles away from me was pretty much flattened.

We got lucky.

And despite the destruction, the people here are another reminder of why I love living in this town.

Thank you, Nashville.

Saturday, February 29, 2020

Happy Leap Day!

To be today, a year has to:

- Be divisible by 4
- NOT be divisible by 100
    - UNLESS it is also divisible by 400

Since 2020 meets the requirements:


HAPPY LEAP DAY!!!


... or as it's known to some who are finding out today that they messed up a date calculation somewhere,
March 1.

Sunday, February 2, 2020

Even More Date Masking..... Sorta

Today is is the 2nd day of February in the year 2020. And just like any palindrome, this means that it's written the same both forwards and backwards.

Today is a Palindrome Day!

Palindrome Days are pretty rare, except for the first few centuries of a new Millennium, which is where we currently find ourselves. I was here for the start of this Millennium, but (...since I don't want to make my vampire traits overly obvious and draw the attention of Buffy & Friends...), I doubt I'll be here for the start of the next one.

What makes this one pretty cool, is that it doesn't matter which of the two main maskings you use, mmddyyyy or ddmmyyyy, today will be the same. It's also pretty much the only day within my lifetime that the non-ISO date formatting simply doesn't matter.

Since I'm in the U.S., and we want to be different from pretty much everyone else, I commonly see my standard American mmddyyyy masking. That makes today 02022020. Or if you reverse it, it becomes 02022020.

But say I was looking at today from somewhere that is pretty much the rest of the world. Today is ddmmyyyy: 02022020. It still gets to be a palindrome!

It's also the 33rd day of the year AND there are 333 days left in the year.

Courtesy of https://www.pinterest.com/pin/523684262891075625/
Geek Overload = 11!
Since my brain has already exploded, this morning, at 02:02:20 UTC (or your local timezone if you're cheating), we can kick that palindrome out to a time component.

What if we go with ISO-8601 standard formatting: yyyymmdd. That's 20200202. The digits shift by a character, but we're still a palindrome. We have hit a palindrome date in 3 different formats!

This also makes today a Global Palindrome Day!

Our last one was November 11, 1111. I wasn't there for that one either. And our next one won't occur until 12/12/2121. Oddly enough, my son's birthday is December 12. But that date is slightly above the Guinness Record for Oldest Person. Who knows. At that point, he'd be over 120 years old. It would be pretty cool to cement a fairly interesting and likely unique Guinness Record.

But, once again, I offer you a very geeky Happy Global Palindrome Day!