Very Strange Ubuntu Issues

I’m running Ubuntu 11.04 “Natty Narwhal” on a custom box, and have been plaqued with sound issues.  Well, one sound issue, and it’s the one you are expecting if you came here by search: Pulseaudio crackles in every application.  Whether speakers or headphones, audio out the front or off the card in the back; it’s bad.  Although in the Prefs panel for sound, the test tone does not crackle.  Key troubleshooting point there–I believe from the reading that that sound test does not go through Pulse.

So I wanted to whack pulse.  Did some reading.  Saw (going from memory here)

killall pulseaudio
apt-get remove pulseaudio
apt-get install esound

And restart. So I did apt-get -s [commands etc], which is the “do-nothing” dry run, just-checking option. Looked good. Then … Continue reading

SQL Query of the Day — Group By Year

This fellow has a blog, and it’s good: Grouping datetime by date in T-SQL « SQL Disco.  Many times in SQL you need to group by year, or by date, and what you have to work with is a big nasty DATETIME field.  I needed to find out how many updates had been done each year, and I had gnat’s ass quality timestamps, down to the second.

I know what you’re thinking, but if you use CONVERT(dtgMyDate), you’re doing it wrong, as our friend at SQL DISCO points out.  In his example, he groups by day; in this one, I have modified it to group by year:

SELECT DATEADD(yyyy,(DATEDIFF(yyyy,0,dtgMyDate)),0),
COUNT(*)
FROM Table1 GROUP BY DATEADD(yyyy,(DATEDIFF(yyyy,0,dtgMyDate)),0)

You see what he does there? Instead of costly CONVERT, … Continue reading