Site Happiness

6

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

-- Happiness is proportional to % of votes that were upvotes.
DECLARE @S float
SELECT @S = (1.0*SUM(IIF(VoteTypeId=2,1,0))/COUNT(*)-0.85)/0.15 FROM Votes WHERE VoteTypeId IN (2,3)
SELECT TOP 360
  COS(ROW_NUMBER() OVER (ORDER BY Id) * 3.1415927 / 180.0) x, '',
  SIN(ROW_NUMBER() OVER (ORDER BY Id) * 3.1415927 / 180.0) y
FROM PostHistory
UNION ALL SELECT x,' ',(y+0.45)*@S-0.45 FROM (SELECT TOP 120
  0.7*COS((30 + ROW_NUMBER() OVER (ORDER BY Id)) * 3.1415927 / 180.0) x,
  -0.7*SIN((30 + ROW_NUMBER() OVER (ORDER BY Id)) * 3.1415927 / 180.0) y
FROM PostHistory) f
UNION ALL SELECT TOP 360
  0.15*COS(ROW_NUMBER() OVER (ORDER BY Id) * 3.1415927 / 180.0) - 0.35 x, '   ',
  0.15*SIN(ROW_NUMBER() OVER (ORDER BY Id) * 3.1415927 / 180.0) + 0.35 y
FROM PostHistory
UNION ALL SELECT TOP 360
  0.15*COS(ROW_NUMBER() OVER (ORDER BY Id) * 3.1415927 / 180.0) + 0.35 x, '    ',
  0.15*SIN(ROW_NUMBER() OVER (ORDER BY Id) * 3.1415927 / 180.0) + 0.35 y
FROM PostHistory
UNION ALL SELECT -2.5, '     ', 0
UNION ALL SELECT 2.5, '      ', 0

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results