Author: way0utwest

  • SQL Saturday #77 – Pensacola Recap

    sqlsat77_bThis past weekend I went down to Pensacola, FL for SQL Saturday #77. This was the third event in Pensacola, and my third time going down there. It was also the second time that I brought my daughter along for the trip. She had a great time the first time, and was good about spending Fri night and Saturday at the event in exchange for a couple days in Pensacola.

    Me, Tim Radney, and Karla Landrum

    I arrived early, on Thursday, spending all day Friday with my daughter until the speaker party on Friday night. The opening event was amazing, at Hemingway’s Island Grill, just across the causeway at Pensacola Beach, on a deck looking out over the water. With a cool evening, we couldn’t have asked for a better setting where I had the chance to sit and talk with Aaron Nelson a bit, met Wayne Sheffield for the first time, and of course, sp

    ent time with Karla Landrum as well.

    sqlsat77_a

    The coolest shirts were available for speakers, me being above, and separate shirts for the women. My daughter, and Aaron’s daughter, got shirts as well, and you can see them here. My little girl loved hers and wore is as much as she could all weekend. I don’t think speaker shirts are necessary, but they are a nice touch, and I love the creative ones I’ve gotten at this event, Cleveland, and Baton Rouge last year.

    The event was held at a local college, as it has the last three years. The entrance and building moved this year, mostly because the Mac user group refused to move their meeting or give up the auditorium they have, so boo on them. In any case, there was a motorcycle class happening in one parking lot, which caused a number of people to get confused as where to go. We suspect a few people were annoyed and left, which is something to be aware of. Ask about any potential traffic situations on the day of the event that might be going on.

    I arrived a bit late, and the event was quiet. Everyone was in sessions except a few speakers and vendors were learning something. With sessions spread out across two buildings, it was definitely a calmer event than I’ve seen in the past. The vendors had a nice walkway through the entrance hallway, on the way to food, and they had good traffic at lunch and as people were leaving. However I’m not sure how well this layout worked during the day as people could go from session to session without moving past tables.

    I realize that sponsorship is a tricky thing to balance with not annoying attendees but also allowing vendors a chance to get value for their sponsorship. I think I’d like to see vendors in between session rooms, giving people a chance to talk by, or vendors to show off some video or demos as people walk by.

    My first session was just before lunch, in the far building, and I had good attendance. With my daughter laying down in front of the room with a DVD, I delivered my talk on Branding Yourself for a Dream Job – The Modern Resume. I had about 40 or so people in there, with a mix of people looking for work, looking for new work, and just interested. I got some great comments, and people said nice things afterwards, even though it was a quiet crowd, and hard to get them to interact with me.

    sqlsat77_eI had a short break before a lunchtime Red Gate demo session, which was very well attended. Again, about 40-50 people watched me demo a few tools, showing them a few ways in which Red Gate tools make life easier. Right after lunch, I had a third session in a row, my Preparation for Disaster, a look at the types of things that need to go into preparing for things to go wrong with SQL Server. It’s a basic session, and perhaps it wasn’t well described as I only had about 10 people in there. However they seemed to like the session from the comments.

    After that I left for a break, my voice tired, and my daughter wanting a chance to swim a little before the after party. We arrived as the party was getting going, walking in with a few other people. It was a Rosie O’Grady’s with the old fashioned fire truck out front in Pensacola downtown. I had the chance to chat with a few more people, eat some great BBQ, and relax for a bit. With the iPad in hand, my daughter and Aaron’s little girl occupied themselves for quite awhile.

    Aaron, me, and our not-so-little girls

    I think I was expecting a busier event, but last year TechEd was the week after this event, and a short drive over to New Orleans, so there were quite a few more people I knew coming to speak. This year it was quieter, more restrained, but still a great event. Pensacola is a beautiful place, great beaches, and worth taking a day or two extra to relax on the gulf coast after some SQL Server learning.

    My daughter is already asking if we can come back next year.

  • Why Can’t We Code?

    Maybe we need a new test for developers?

    I think that most of the developers or data professionals out there have been through a variety of types of interviews in their careers. You might have had technical interviews that asked you to write code, or maybe you’ve been quizzed on SQL Server trivia or asked to explain methods and properties. Maybe you’ve had interviews with managers that had you define a few database terms. Perhaps you’ve just had someone ask you the ten co

    mmon interview questions without requiring you to demonstrate any technical knowledge.

    No matter what you’ve experienced, I think that many people would agree that the hiring process needs work. It does a poor job of actually pre

    dicting if the new employee can produce quality code or manage servers. Why is that?

    Many companies have really tried to solve this. From the famous “How would you move Mt. Fuji?” questions at Microsoft to the common CS type questions at Google. Joel Spolsky has his own guerilla guide, which I assume has worked well for him, though on a much smaller scale. I think, however, that for the most part no one has come up with a good way to solve this issue.

    A friend sent me this piece recently: Why the New Guy Can’t Code. It’s a little heavy handed, but there was one quote in there that I thought made sense: “don’t interview anyone who hasn’t accomplished anything. Ever.” It’s so easy to set up your own website, design a database on your personal machine, even put an app out for sale, that there’s no excuse not to make some effort to accomplish something. Craig Farrall

    talked about building something in Looking for Work in SQL Server, as did Brandie Tarvin in Changing Career Gears. It’s also one of the things I talk about at the Modern Resume: show people what you’ve done.

    I don’t know that we’ll ever find a fool proof way to hire great employees, but hiring people that have proven themselves in the past, and can point to something they’ve done, is good start.

    Steve Jones


    The Voice of the DBA Podcasts

  • Combinations and Permutations

    I ran into an interesting question from someone asking for all combinations of numbers. The thread was here, and it was confusing at first. However we started to understand what was being asked and eventually the person stopped, realizing that there were too many combinations.

    However at one point there was this quote: I’m looking for combinations, not permutations since the order is unimportant.

    That surprised me since I was thinking of things in the opposite manner. However when I read this article, it made sense: combinations and permutations

    There is a table in the article that cleared it up. I’ve reproduced it here:

    Order does matter Order doesn’t matter

    1 2 3

     

    1 3 2

     

    2 1 3

    1 2 3

    2 3 1

     

    3 1 2

     

    3 2 1

    The left hand side is permutations, where order matters. The right hand side is combinations, of which there is only one. Order doesn’t matter so 1-2-3 is the same as 1-3-2, which is the same as 3-2-1 and all other orderings.

    This shows mathematical semantics, but those are important in SQL because we do need to talk about combinations and permutations. A CROSS JOIN is normally how we handle combinations, which for three numbers are usually thought of as the way to handle all combinations, but I’m not sure how that works here.

    If I create a quick table:

    CREATE TABLE Combinations
    ( id int) GO INSERT Combinations select 1
    INSERT Combinations select 2
    INSERT Combinations select 3

    and then perform a cross join:

    SELECT a.id, b.id
     FROM Combinations a
       CROSS JOIN dbo.Combinations b

    I get this:

    id          id

    ———– ———–

    1           1

    2           1

    3           1

    1           2

    2           2

    3           2

    1           3

    2           3

    3           3

    Not all combinations. Even if I add in a third result:

    SELECT a.id, b.id, c.id
     FROM Combinations a
       CROSS JOIN dbo.Combinations b
       CROSS JOIN dbo.Combinations c

    id          id          id

    ———– ———– ———–

    1           1           1

    1           2           1

    1           3           1

    1           1           2

    1           2           2

    1           3           2

    1           1           3

    1           2           3

    1           3           3

    2           1           1

    2           2           1

    2           3           1

    2           1           2

    2           2           2

    2           3           2

    2           1           3

    2           2           3

    2           3           3

    3           1           1

    3           2           1

    3           3           1

    3           1           2

    3           2           2

    3           3           2

    3           1           3

    3           2           3

    3           3           3

    However, what about if I limit the result to remove duplicates:

    SELECT a.id, b.id, c.id
     FROM Combinations a
       CROSS JOIN dbo.Combinations b
       CROSS JOIN dbo.Combinations c
    WHERE a.id != b.id
    AND b.id != c.id
    AND a.id != c.id

    That seems to work better:

    id          id          id

    ———– ———– ———–

    1           3           2

    1           2           3

    2           3           1

    2           1           3

    3           2           1

    3           1           2

    However that’s not a great solution. I’ve hardcoded the number of items, and it’s a cumbersome query. I think there has to be a better solution, but it’s probably one that’s beyond my T-SQL skills. If I look at 5 numbers, I get this:

    SELECT a.id 'a', b.id 'b', c.id 'c', d.id 'd', e.id 'e' FROM Combinations a
       CROSS JOIN dbo.Combinations b
       CROSS JOIN dbo.Combinations c
       CROSS JOIN dbo.Combinations d
       CROSS JOIN dbo.Combinations e
    WHERE a.id != b.id
    AND a.id != c.id
    AND a.id != d.id
    AND a.id != e.id
    AND b.id != c.id
    AND b.id != d.id
    AND b.id != e.id
    AND c.id != d.id
    AND c.id != e.id
    AND d.id != e.id
    ORDER BY a, b, c, d

    I get 120 rows. If I look at 5!, that’s 120, so I think I’m correct. I’m not duplicating all the results, nor am I  going to look through them all, but they seem correct and ordered.

    The thing this solution leaves out is the combinations that are less than the total number of items, as asked in the thread. So expanded combinations would be:

    1

    2

    3

    4

    5

    1 – 2

    1 – 3

    1 – 4

    1 – 4

    1 – 2 – 3

    Not worth including those, but I think that would result in a series of UNION queries, which would get really ugly.

    I’ll ask around, but if anyone has an interesting way to solve this that’s cleaner, I’d be interested.

    Update

    Someone posted this, which seems to work wonderfully:

    DECLARE @s VARCHAR(25)
    ,@Iteration Int
    SET @s = ‘ABC’;
    SET @Iteration = LEN(@s);

    WITH E1(N) AS ( –=== Create Ten 1’s
    SELECT 1 UNION ALL SELECT 1 UNION ALL
    SELECT 1 UNION ALL SELECT 1 UNION ALL
    SELECT 1 UNION ALL SELECT 1 UNION ALL
    SELECT 1 UNION ALL SELECT 1 UNION ALL
    SELECT 1 UNION ALL SELECT 1 –10
    ),
    cteTally(N) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT N)) FROM E1
    ),CteCombos AS (
    SELECT CAST(SUBSTRING(@s, N, 1) AS VARCHAR(25)) AS Token,
    CAST(‘.’+CAST(N AS CHAR(1))+’.’ AS VARCHAR(52)) AS Permutation,
    CAST(1 AS INT) AS Iteration
    FROM cteTally WHERE N <= @Iteration
    UNION ALL
    SELECT CAST(Token+SUBSTRING(@s, N, 1) AS VARCHAR(25)) AS Token,
    CAST(Permutation+CAST(N AS CHAR(1))+’.’ AS VARCHAR(52)) AS
    Permutation,
    s.Iteration + 1 AS Iteration
    FROM CteCombos s
    INNER JOIN cteTally n
    ON s.Permutation NOT LIKE ‘%.’+CAST(N AS CHAR(1))+’.%’
    AND s.Iteration < @Iteration
    AND N <= @Iteration
    )
    SELECT Token,Permutation,Iteration
    FROM CteCombos
    WHERE Iteration = @Iteration
    ORDER BY Permutation

    If you alter the variable (abc) to the number of items you need, so “abcde” for 5, this returns the combinations.

  • Economics

    Not a good day for this Cowboys fan.

    Today we have an editorial from Mar 22, 2006 as Steve is on vacation.

    Terrell Owens signs with the Cowboys and I’m not thrilled. As a longtime fan of Dallas, I’d have preferred that they get someone else, despite his talent. Too much baggage. Alfonso Soriano refuses to play outfield for the Nationals this week, disobeying his manager who asked him to go out there during a game. Lots of people are upset with this “spoiled” athlete who makes $10 million a year and won’t listen to his boss.

    There’s way more stories of this type of behavior than there are positive ones. But how do these individuals get away with this behavior and still command such high salaries?

    It’s called economics. There are many people, often sports or entertainment stars, that have a supply of something: talent. And with the demand out there to see them, the price goes up. It’s a simple graph from basic Economics 101, like the one shown below. I learned about this early in my college career, as the supply goes down, as in one or two superstar wide receivers in football, the price goes up. In this case to $10 million for Mr. Owens this year. If you can have that kind of demand for your services, than you can easily get more money. And it’s not limited to sports.

    Supply and demand often determines what we pay.

    I have a friend that manages a development team. This manager requires the team to read software development materials from the team library, which contains books, magazines, etc. that pertain to their business. Often there are magazines passed around and the developers are asked to read for an hour a week and note a sentence or two that shows they read something. My friend even gives them the hour during work hours as a way to encourage personal development and growth of the developers.

    Recently one developer said that they didn’t want to read one week. Since it was a busy week, the team working overtime, my friend didn’t complain too much. However the developer went further in saying they didn’t think they should have to read and that if they did, they should be able to pick anything, not just from the library. No suggestions or, hey, could you get a copy of Professional SQL Server 2005 Integration Services, nothing other than a complaint.

    My friend was a little put off by this. After all, my friend is trying to help the team grow, looking to ensure they do not become stagnant and wanting to foster a professional environment. And giving away work time to do it, not requiring the developers to find time at night or on the weekends.

    I’ve seen this behavior more and more over the last 7 or 8 years than the 7 or 8 prior to that that I’ve been in this business. As the demand for IT services has gone up, many people have gotten inflated salaries and the ego to go with them. Too many IT workers think they’re above some work or don’t think they need to improve or companies should place additional demands on them. This goes from requiring certifications or training to not being willing to help out in lesser skilled areas.

    Maybe I’m getting old. Maybe I’m from a different time, but I think that requiring you to keep learning isn’t a problem in IT. After all, technology changes rapidly and it benefits you. And requiring it on company time shouldn’t be an issue. Asking me to help out with a ticket queue and assigning ACL permissions to individuals won’t generate a complaint from me.

    Heck, it’s much easier than doing SQL work and the pay’s the same.