Saturday, August 18, 2018

Piece and sadness a story of a couple


"But today feels like a really big day. I've spent almost seven years—seven years—going to the same place at the same time on the same days of the week. Those seven years have been pretty lovely, and I feel so fortunate to have had what was really a pretty great job. The people were wonderful, the work was service-oriented, the hours were flexible, the salary was good. I got health insurance and paid time off and a whole lot of autonomy. I had some patient bosses who put up with me taking three-month-long sabbaticals every year, who let me bend the rules just to their breaking point.
I'm grateful for the opportunity, and I'm anxious to turn my back on what was really a good thing. But getting too cozy is dangerous. Inertia is a stealthy predator. I've learned a lot from these seven years, and I enjoyed plenty, but with each passing year I feel I learned a little less. The days have blended into weeks, the weeks into months, the months into years. I've grown tired of meetings, of teleconferences, of timesheets and password changes and Monday morning elevator commiseration. I've grown tired of spending the best hours of my day in front of a glowing rectangle, of coloring the best years of my life in swaths of grey and beige. I've missed too many sunsets while my back was turned. Too many thunderstorms went unwatched, too many gentle breezes unnoticed. There's magic out there, in this great big beautiful world, and I've long since scooped up the last of the scraps to be found in my cubicle.
I know there's another way to live. I've dabbled in it. But now it's time to commit. To go all-in. I'm thankful for this privilege. The privilege to commit. The privilege to walk away from a well-paying life of comfort. To charge headlong into indulgence, rough but ultimately temporary. To make this choice. I recognize it's not a choice everyone has. I don't intend to be flippant, ungrateful. I am deeply appreciative.
I quit my job today. I'm terrified. I'm thrilled.” -- Jay Austin

On July-29/2018 he and his friend were killed while bike riding thru Tajikistan by ISIS.

Tuesday, May 22, 2018

Wouldn't it be great?

Wouldn't it be great to be hugged by a large foreign woman? You can't understand what shes says but she greets you with a hug. At first you are somewhat withdrawn.Tentative at best. But then over the years you squeeze her like she is your best friend. You embraced her like a child with a teddy bear. You are held for just a moment but will remember it for a life time. Wouldn't it be great?😔

Friday, May 18, 2018

Spotify: 3 month Trial for 0.99

Spotify.com is offering an Introductory Trial PromotionGet 3-Months of Spotify Premiumfor $0.99. If you have subscribed to the Premium or Unlimited service or have taken a 30-day free trial offer or 60-day free trial offer previously, you are ineligible for this introductory trial offer. This is a trial and after your first 3 months, you will be charged full price unless you cancel.


Sunday, January 7, 2018

SQL: Finding an assistant using a recursive CTE

Was looking for SQL that would allow me to find an Employee's assistant. It requires a somewhat recursive function:

create table EMPLOYEES
    (EmpID    int         unique Not null,
     Name    varchar(10),
     AssistantID int,
     Primary key(EmpID));

insert into EMPLOYEES values (1,'Bob', NULL);
insert into EMPLOYEES values (2,'Susan', 3);
insert into EMPLOYEES values (3,'John', 4);
insert into EMPLOYEES values (4,'Mary', 6);
insert into EMPLOYEES values (5,'Bill', NULL);
insert into EMPLOYEES values (6,'Fred', NULL);
insert into EMPLOYEES values (7,'Anderson', 1);
insert into EMPLOYEES values (8,'Gill', 9);
--insert into EMPLOYEES values (9,'Jerry', 8);

I wanted to for example find Mary's assistant (e:g Fred). There's a recursive case where to find Susan's assistant we go: Susan -> John -> Mary -> Fred. I also want Bob's assistant which is himself.
Here's one solution:

WITH RCTE AS
(
    SELECT * , EmpID AS TopEmp
    FROM EMPLOYEES c
 
    UNION ALL
    SELECT c.* , r.TopEmp
    FROM dbo.EMPLOYEES c
     INNER JOIN RCTE r ON c.EmpID = r.AssistantID
)
select EmployeeName,Assistant from
(
SELECT
  e.EmpID AS EmployeeId,
  e.Name AS EmployeeName,
  r.Name AS Assistant,
  r.EmpID AS AssistantId
FROM RCTE r
inner join EMPLOYEES e ON r.TopEmp = e.EmpID
where r.AssistantID is null
) Records

Result:

| EmployeeName | Assistant |
|--------------|-----------|
|          Bob |       Bob |
|         Bill |      Bill |
|         Fred |      Fred |
|     Anderson |       Bob |
|         Mary |      Fred |
|         John |      Fred |
|        Susan |      Fred |