Posts

Service Broker sys.transmission_queue clean up

If you’re developing a Service Broker application and you misspell your services, forget to create a master key, or do any of the many things that result in your messages not being delivered, then your transmission queue will fill up. Due to the nature of service broker, errors don't occur at the client but rather your messages go in to Service Brokers sys.transmission_queue and are then subsequently processed. If they fail, they stay in the queue. Some errors can be resolved, i.e. missing services. However, others can't, or are just plain difficult. I.e. You've misspelt something, or not used the correct security. To clear your transmission queue you need to end the conversations, this is a handy little script for doing this. Be aware this ends ALL conversations in the queue and so should NEVER be used on a production system. To see how many messages are in your transmission queue, use this SELECT   COUNT ( 1 )   FROM   sys . transmission_queue On my system i7, D...

How to dump your Skype database to a text file for easy searching

I had a problem recently trying to search the Skype instant messeage history. Searching for a historical chat can be done in Skype by pressing CTRL-F, but only if you know the person(s) that were involved on that chat. You cannot search the chat history globally. The solution is to dump out the skype database into a TXT file for easy searching with notepad. Download SQLite command shell at http://www.sqlite.org/download.html. (I downloaded http://www.sqlite.org/sqlite-shell-win32-x86-3070400.zip ) Extract sqllite3.exe to a place on your path, or somewhere you can run it easily from. Open a DOS command prompt. Change the folder to C:\Users\[pc user name]\AppData\Roaming\Skype\[skype user name] There you should find main.db database. Type the following (in bold): sqlite3 main.db sqlite> .output c:\skype_chat.txt sqlite> .dump sqlite> .quit You can now start Notepad and open file c:\skype_chat.txt to search through.

How to create a Gource graphical repository movie

Image
Download Gource from https://code.google.com/p/gource/ extract to C:\gource-0.28.win32 Download FFMPEG from http://www.videohelp.com/tools/ffmpeg extract to c:\ffmpeg If using SVN also download the following: svn-gource.py from https://code.google.com/p/gource/wiki/SVN extract to c:\python31 Python from  http://www.python.org/download/ I used v3.1.3. extract to c:\python31 In a DOS command prompt type: c: cd C:\Data Files\Projects (Use your own SVN repository location) svn log -r {2011-01-01}:{2010-01-01} --verbose --xml > c:\code-trunk.log cd C:\gource-0.28.win32 The follow is only required if using SVN: c:\python31\python svn-gource.py --filter-dirs c:\code-trunk.log > c:\code-trunk-gource.log gource --log-format custom c:\code-trunk-gource.log -1600x1040 --date-format "%d %B %y" --seconds-per-day 0.5 -a 0.1 --highlight-all-users --stop-at-end --disable-progress --output-ppm-stream c:\code-trunk.ppm --camera-mode overview --bloom-intensity 0.1 --ou...

SQL Server MAXDOP and parallelism

Image
At our company, we have a 4 core blade running SQL Server 2008 Enterprise Edition. This is a very, very busy SQL Server and is running on HP EVA hardware, so the I/O is not an issue. We have over 50 warehouses all running SQL Server 2008 and replicating data to/from this primary database. This database is also used by our website, webservices and import/export applications. The only thing this database does not serve is our SSRS reports, which are hosted on another blade. What is an issue, however, are the CPU's. They were very busy. To help with this we can play around with two settings on SQL Server: MAXDOP (Max degree of parallelism) Cost threshold for parallelism Our DBA and I had a few discussions around this recently. Read plenty of articles on it, such as Adam Machanic On a normal system, leaving these settings alone are fine, but on a very very busy system you need to change them. MAXDOP=1. What this does is to always use 1 core for the query. MAXDOP=0, Cost...

Index Analysis

Some nice articles by Jason Strate on index analysis, page splits, etc.Check them out at: Return of Index Analysis - Part 1   Return of Index Analysis - Part 2   An Index on Indexing #TSQL2sDay   Read the black-ops articles.

Lifeguard

Image
I just found my very first commercial software I wrote in Z80 assembler. It's called lifeguard and can be found here . Its basically an unlimited lives finder for the ZX Spectrum and ran on the Multiface hardware. Romantic Robot made the multiface and distributed it for me. They used to pay me a commssion on a monthly basis. I still remember the algorithm for finding lives, grenades, timers, etc. Good times.

Pex and Moles

Image
Pex and Moles are Visual Studio 2010 Power Tools extension that help Unit Testing .NET applications. Pex automatically generates test suites with high code coverage. Right from the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications.Moles allows to replace any .NET method with a delegate. Moles supports unit testing by providing isolation by way of detours and stubs. The Moles framework is provided with Pex, or can be installed by itself as a Microsoft Visual Studio add-in. Microsoft Moles helps with writing unit tests, but what remains is the tedious task of writing the specific unit tests that exhaustively exercise and validate the logic of the code-under-test. Microsoft Pex can help you in understanding the input/output behavior of your code, finding inputs that cause the code-under-test to crash, and...