If you have a table with a datetime column and you want to group the rows by month, then this can help:
select count(*), datediff(m, datetime_col, getutcdate())
from table
group by datediff(m, datetime_col, getutcdate())
order by 2
Monday, January 18. 2010
windbg - Examining exceptions
This is a nice command to see all the exceptions in the heap (as long as your exceptions have the word Exception in the class name):
.foreach ( obj { !dumpheap -type Exception -short } ) {!DumpObj ${obj} }
Pinched from another blog, and tweaked, but I've blogged it here for my own reference.
.foreach ( obj { !dumpheap -type Exception -short } ) {!DumpObj ${obj} }
Pinched from another blog, and tweaked, but I've blogged it here for my own reference.
Monday, January 11. 2010
Microsoft Connect
Seems to be more of a publicity stunt this, or at best a place for users to discuss problems with each other. Not sure anyone with any real power or knowledge from Microsoft takes any notice of it. Take this synonym bug in SQL Server. It's marked as fixed, but there is only a workaround posted. In my mind a workaround is not a fix, it's a workaround. I assume it's marked as fixed to make someone's performance stats look better. Just corporate bullshit.
Saturday, January 9. 2010
Santa Barbara Bank and Trust - Non Resident Service
Rubbish. I had an account as a non-resident, they then said I needed to reside near the branch to have a non-resident account and gave me 30 days notice. Then, within 10 days, they just froze the account rendering me unable to access the account. Absolutely rubbish and this will cost me hundreds of dollars/pounds as I will now have to travel to the states to open another account at a proper bank.
Friday, December 18. 2009
Saving Outlook msg files using Redemption
Had a strange one the other day. Trying to save msg files using the Redemption library when using the html body property. If the html contatined a word starting with + and ending in -, e.g. +/- , then the text would be enconded in some format I dont recognise. Attempting to open the saved msg then gave the garbled text. I changed the text body using a regular expression to convert the + character to the correspoing unicode encode value (sorry dont have it to hand).
Friday, November 6. 2009
Problem compiling xine-ui on 64bit OpenSuse 11.0
When running make I get:
error: '__xineui_global_lirc_enable' undeclared (first use in this function)
xine-ui's macro for checking for the existence of lirc does not look in the 64 bit library directories (/usr/lib64) and it only looks for the static library versions. On my installation the static (.a) library was only in /usr/lib64 so the configure script did not find it, and turned off lirc support. The fix for me was to just create a link in the /usr/lib directory:
ln -s /usr/lib64/liblirc_client.a .
error: '__xineui_global_lirc_enable' undeclared (first use in this function)
xine-ui's macro for checking for the existence of lirc does not look in the 64 bit library directories (/usr/lib64) and it only looks for the static library versions. On my installation the static (.a) library was only in /usr/lib64 so the configure script did not find it, and turned off lirc support. The fix for me was to just create a link in the /usr/lib directory:
ln -s /usr/lib64/liblirc_client.a .
Thursday, November 5. 2009
Error 80040605 calling new RDOSessionClass
This error has caught me more than once when setting up Redemption for the first time on a new server/workstation where Outlook has never been installed. Redemption needs (full?) access to the key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem which will probably not even exist if Outlook has never been run on the machine. You can create the key and the Profiles subkey manually and give the user creating the RDOSessionClass full access rights. That should get you past this error, but it may then fail trying to delete the temporary profile if you are using impersonation. I don't think Redemption supports impersonation, at least I could not get it to work.
Thursday, October 22. 2009
Verruca treatment with a banana skin
A few weeks ago I developed a verruca on the bottom of my foot. I read on the internet that a fresh banana skin was a cure, so I had to give that a go. I got a skin and sellotaped it across the width of the sole and put a complete loop of tape to hold it in place. That night I removed the skin and the thing had gone all soft. I scraped the soft stuff away and left it open overnight. The next morning I put another skin on, and it was a bit painful to work. Felt like the juice or whatever was coming off the skin was burning the sore that I had made by removing the dead skin. Took that skin of that night, and let it heal. Worked very well, not sure if the second skin was even necessary.
Monday, October 5. 2009
Z Wave reception
I just have the 2 devices, the controller and the adapter. The controller is inside the house and the adapter is around 15 metres away through an outside wall (dual cavity concrete brick and render), and the garage wall, which is just wood. I've found reception is borderline. If the controller is low down I do not get reception, that may be understandable as when its low down I think the straight line has to go through the ground (the garage is lower than the house). Whats more interesting is that the orientation of the AeonLabs controller is a big factor. With the controller in the vertical position, reception (measured by the amount of times I have to try to send the message) is much worse than when in the horiztonal position, and it seems that reception is best when on its side in the horizontal position.
Saturday, October 3. 2009
ZWave power usage
Current use for the UK version of Advanced Control Technologies HomePro(tm) Appliance Module ZRP210:
In off state: 3.4mA
In on state 6.6mA
In off state: 3.4mA
In on state 6.6mA
Wednesday, September 30. 2009
Z Wave
My bits arrived and I've chopped the DCE stuff from ZWApi.cpp (thanks Hari) from LinuxMCE. Not changed much really and converted it into a standalone daemon the same as my IBUS stuff. I will create an IPC MQ to talk to the daemon which is not ideal but is easy to do. Right now the daemon can successfully query for the status of the switch. I'll post the code when its actually does something more useful.
Friday, September 25. 2009
LinuxMCE-devel
I had the misfortune yesterday to go on to this IRC channel to get some help in building LinuxMCE. Within a few lines I had been insulted by someone, dont remember the name, began with T. I persisted a bit longer and then the joker had the arrogance to say that I would get further, quicker if I worked with him.... Our survey said "ee uurrrrr". Wrong, he/she would get further if he/she learnt some manners.
I don't know why I bothered going back to LinuxMCE. I remember being told something like "why don't people buy the hardware I want them to buy", by someone from this group when I asked how to get some dvb card working. That was I while back before I discovered vdr and XBMC.
I don't know why I bothered going back to LinuxMCE. I remember being told something like "why don't people buy the hardware I want them to buy", by someone from this group when I asked how to get some dvb card working. That was I while back before I discovered vdr and XBMC.
Thursday, September 24. 2009
Z Wave
I've just ordered some Z-Wave components from Zwave4U and I've been looking around for some software to control them. If I want Linux open source (which I do), then I seem to have 2 choices, one is the homedaemon software, and the other is LinuxMCE. I'm going to start with LinuxMCE as it seems more active in the ZWave space and has support for the USB device that I've bought (Aeon). I don't really want to install all of LinuxMCE as I already have a media centre, but chatting on the forums, I understand that I can run just the DCERouter/mysql and I should be good to go with MessageSend. I don't like mysql but I will live with that for now, I suspect that the SQL needed by the DCERouter is not that complicated/mysql specific and could be ported fairly easily.
To start with I will download the trunk for LinuxMCE. Takes a long time as there is a lot of stuff that I do not want, and will delete later.
To start with I will download the trunk for LinuxMCE. Takes a long time as there is a lot of stuff that I do not want, and will delete later.
Thursday, August 27. 2009
jQuery liScroll
I found jQuery the other day while looking for a ticker tape scolling control to put in an ASP.Net page. I found this very neat example at this site which also has some other concise jQuery examples. There is one problem with the liScroll code however. If the width of the total number of ticker tape items is short compared to the ticker window then the speed of the tape changes after the stop on hover over. I think this is down to the following lines:
The timing needs to be a factor of the total distance the div is moving, not just the width of the div. I think it should be:
var defTiming = stripWidth/settings.travelocity;
var totalTravel = stripWidth+containerWidth;
The timing needs to be a factor of the total distance the div is moving, not just the width of the div. I think it should be:
var totalTravel = stripWidth+containerWidth;
var defTiming = totalTravel/settings.travelocity;
Thursday, July 23. 2009
SQL server memory usage per database
SELECT
(CASE WHEN ([database_id] = 32767) THEN 'Resource Database' ELSE DB_NAME (database_id) END) AS 'Database Name',
SUM(CASE WHEN ([is_modified] = 1) THEN 1 ELSE 0 END) AS DirtyPageCount,
SUM(CASE WHEN ([is_modified] = 1) THEN 0 ELSE 1 END) AS CleanPageCount
FROM sys.dm_os_buffer_descriptors
GROUP BY database_id
ORDER BY DB_NAME(database_id)
GO
(CASE WHEN ([database_id] = 32767) THEN 'Resource Database' ELSE DB_NAME (database_id) END) AS 'Database Name',
SUM(CASE WHEN ([is_modified] = 1) THEN 1 ELSE 0 END) AS DirtyPageCount,
SUM(CASE WHEN ([is_modified] = 1) THEN 0 ELSE 1 END) AS CleanPageCount
FROM sys.dm_os_buffer_descriptors
GROUP BY database_id
ORDER BY DB_NAME(database_id)
GO
Posted by Scott Waye
at
11:24
(Page 1 of 5, totaling 68 entries)
next page »


