Merry Christmas 2015

  • Comments posted to this topic are about the item Merry Christmas 2015

  • Merry Christmas Steve

    😎

  • Marry Christmas and thanks for your work on the SSC.com, Steve.:-)

    Jiri Vobr, Czech Republic.

  • Try this one:

    SELECT geometry::Parse('POLYGON((

    4 0, 0 0, 3 2, 1 2, 3 4, 1 4, 3 6, 2 6,

    4 8, 6 6, 5 6, 7 4, 5 4, 7 2, 5 2, 8 0, 4 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    2.5 0, 3 -1, 5 -1, 5.5 0, 2.5 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    4 7.5, 3.5 7.25, 3.6 7.9, 3.1 8.2, 3.8 8.2,

    4 8.9, 4.2 8.2, 4.9 8.2, 4.4 7.9, 4.5 7.25, 4 7.5

    ))')

    UNION ALL

    SELECT geometry::Point(

    RAND(CHECKSUM(NEWID())) * 5 +1.5,

    RAND(CHECKSUM(NEWID())) * 6, 0

    ).STBuffer(0.3)

    FROM master.dbo.spt_values

    WHERE type = 'P' AND number BETWEEN 1 AND 20;

  • arnierowland (12/25/2015)


    Try this one:

    SELECT geometry::Parse('POLYGON((

    4 0, 0 0, 3 2, 1 2, 3 4, 1 4, 3 6, 2 6,

    4 8, 6 6, 5 6, 7 4, 5 4, 7 2, 5 2, 8 0, 4 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    2.5 0, 3 -1, 5 -1, 5.5 0, 2.5 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    4 7.5, 3.5 7.25, 3.6 7.9, 3.1 8.2, 3.8 8.2,

    4 8.9, 4.2 8.2, 4.9 8.2, 4.4 7.9, 4.5 7.25, 4 7.5

    ))')

    UNION ALL

    SELECT geometry::Point(

    RAND(CHECKSUM(NEWID())) * 5 +1.5,

    RAND(CHECKSUM(NEWID())) * 6, 0

    ).STBuffer(0.3)

    FROM master.dbo.spt_values

    WHERE type = 'P' AND number BETWEEN 1 AND 20;

    Nice, trying to explain it to my 6 years old:-D

    😎

  • Merry Christmas for you , Steeve and for every posters on this discussion.

    Knowing Steve's humor , I have only 2 possibilities ; the Christmas tree and the reindeer, the 1st one seemed me the most probable one. So thanks for these points.

    Sorry to be so late but I was busy with the visit of our elder son , everybody was here for our 1st Christmas in Britany ...

  • Arnie , happy Christmas for this beautiful Christmas tree.

    A solution more complicated than the Steve' one but to see it is a pleasure , I have to have a look at the geometry topic I have not used since 5 years.

    I have not seen you on the forums , but it is true that we are not often on the same ones.

  • Ahhhh. How cute is that...

  • arnierowland (12/25/2015)


    Try this one:

    SELECT geometry::Parse('POLYGON((

    4 0, 0 0, 3 2, 1 2, 3 4, 1 4, 3 6, 2 6,

    4 8, 6 6, 5 6, 7 4, 5 4, 7 2, 5 2, 8 0, 4 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    2.5 0, 3 -1, 5 -1, 5.5 0, 2.5 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    4 7.5, 3.5 7.25, 3.6 7.9, 3.1 8.2, 3.8 8.2,

    4 8.9, 4.2 8.2, 4.9 8.2, 4.4 7.9, 4.5 7.25, 4 7.5

    ))')

    UNION ALL

    SELECT geometry::Point(

    RAND(CHECKSUM(NEWID())) * 5 +1.5,

    RAND(CHECKSUM(NEWID())) * 6, 0

    ).STBuffer(0.3)

    FROM master.dbo.spt_values

    WHERE type = 'P' AND number BETWEEN 1 AND 20;

    Not sure what this was supposed to be. It didn't seem to work on my 2008 R2.

  • Works in 2008R2 -BUT you have to view the 'Spatial Results' tab.

  • Iwas Bornready (12/27/2015)


    Ahhhh. How cute is that...

    It's working on SQL Server2014 Express and I have looked at the Spatial Results panel ( between the Results and Messages panels )

  • The "order by" clause misses!

    Try this:

    declare @image as table (

    row_id tinyint

    primary key clustered (row_id desc)

    );

    insert into @image(row_id)

    values(1),(2),(3),(4),(5),(6),(7),(8),(9)

    select

    case

    when max(i.row_id) over() - i.row_id > 1 then replicate(' ', max(i.row_id) over() - 2 - i.row_id) + replicate('*',i.row_id) + replicate('*',i.row_id-1)

    else replicate(' ', max(i.row_id) over() - 3) + '|'

    end img

    from @image i

  • I hope everyone had a very Merry Christmas and enjoyed time with family.

  • arnierowland (12/25/2015)


    Try this one:

    SELECT geometry::Parse('POLYGON((

    4 0, 0 0, 3 2, 1 2, 3 4, 1 4, 3 6, 2 6,

    4 8, 6 6, 5 6, 7 4, 5 4, 7 2, 5 2, 8 0, 4 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    2.5 0, 3 -1, 5 -1, 5.5 0, 2.5 0

    ))')

    UNION ALL

    SELECT geometry::Parse('POLYGON((

    4 7.5, 3.5 7.25, 3.6 7.9, 3.1 8.2, 3.8 8.2,

    4 8.9, 4.2 8.2, 4.9 8.2, 4.4 7.9, 4.5 7.25, 4 7.5

    ))')

    UNION ALL

    SELECT geometry::Point(

    RAND(CHECKSUM(NEWID())) * 5 +1.5,

    RAND(CHECKSUM(NEWID())) * 6, 0

    ).STBuffer(0.3)

    FROM master.dbo.spt_values

    WHERE type = 'P' AND number BETWEEN 1 AND 20;

    Extremely cool!

  • Carlo Romagnano (12/28/2015)


    The "order by" clause misses!

    Try this:

    declare @image as table (

    row_id tinyint

    primary key clustered (row_id desc)

    );

    insert into @image(row_id)

    values(1),(2),(3),(4),(5),(6),(7),(8),(9)

    select

    case

    when max(i.row_id) over() - i.row_id > 1 then replicate(' ', max(i.row_id) over() - 2 - i.row_id) + replicate('*',i.row_id) + replicate('*',i.row_id-1)

    else replicate(' ', max(i.row_id) over() - 3) + '|'

    end img

    from @image i

    An upside down ISS Christmas tree - nice!

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply