Tuesday, February 23, 2010

cool synonym app

http://www.lexipedia.com/english/mutually+exclusive

Monday, February 8, 2010

Dexter ambient guitar tab

Dexter fan? Here’s the basic tabs for the ambient guitar in the series. (Copy/paste to Notepad or similar. Rest of the tune is variations of this)

E --------------------------------------------------------------------------------------------
H --------8-----------7--------------------------------------------------------8--7--7-h-8-
G -----------9-----------7--------7-----6--------------4-----------6-----------------------
D -----9-----------7-----------7-----7--------------5-----5-----7-----7-----9-------------
A --7-----------5---------------------------------------------------------------------------
E --------------------------5--------------0--2--3-----------5-----------7-----------------


http://www.youtube.com/watch?v=uM7O-SfJd2U
http://www.youtube.com/watch?v=r07OF9-gom0&NR=1

Monday, October 12, 2009

Version control of database objects

To ease the pain of keeping version control of database objects I created a nAnt script for synching stored procs, triggers, functions and views. Using sql server 2008 (but earlier versions are good too, but you may need to change some element types (see script-files) to make it work), TFS and standard scripting.

What happens?
1. the nant-build will process SPs, Views, Functions and Triggers. (but not Tables, table contents and SSIS as this requires some more work)
2. It asks the database about the objects (e.g. all SPs) and their ids
3. It stores the result as a csv-file with "objectName, objectID" format (in file "scriptResult.txt").
4. It goes through each pair and fetches the CREATE-script for each objectID in the database
5. It creates a file with name: [objectName].sql and places it in a folder according to type
6. It then removes all files in [workspace]/dev/database/[object type] and copies the created scripts over
7. It then calls tfpt to synch what is added, deleted and edited (the changelist is connected to the user who ran the script)

NOTE:
1. The db connection is set to be "trusted" (using your windows auth). But as the scripts use osql/bcp it is easy to change this to db-credentials.
2. The script only supports a dev-branch (should be easy to extend).

The scripts:
All of it in a zip (so that you do not need to wait unnecessary...)
Each file, with description:
  1. This starts the whole thing, it just calls a nAnt with the correct target
    RunTFSSynchOfDBObjects.cmd
  2. This runs through all the supported objects to backup
    FetchDBObjectsAndGetScripts.build
  3. Each target in the nAnt in step 2. calls this script to fetch object name and id (puts it in the "scriptResults.txt" file), you'll need to change the db-server and db-name in this one:
    FetchObjectsAndIdsGivenAnObjectType.cmd
  4. Each target in the nAnt in step 2. goes through the "scriptResults.txt" (the csv-file) and then calls
    GetScriptForObject.cmd
    to get the sql script for the current "objectName, objectID". You'll need to change the db-server name in this one. Note; this uses bcp (bulk copy) as some db-object-scripts are too large for osql.
  5. The nAnt in step 2. then calls script for copying result files to your TFS workfolder, synching with TFS and adding changes to your "pending changes" list. Note; you'll need to refresh the "pending changes" list if source control GUI is currently open. In the script
    CheckOutScriptFilesAndReplaceWithNewContent.cmd
    you'll need to set your workfolder. Follow instructions in the file.

Thursday, January 18, 2007

Links

Dot net code: http://www.koders.com/

Wednesday, January 17, 2007

VS macro for collapse of nodes, incl. projects

This is a combination of two sources:
  1. Edwin Evans posting to "The code project" :
  2. Additional "CollapseNode" method provided by Odd Helge Gravalid


Sub CollapseNode(ByRef item As UIHierarchyItem)
Dim subitem As UIHierarchyItem
For Each subitem In item.UIHierarchyItems
'No way of knowing type of the UIHierarchyItems, exclude non-Expandable ones on name to reduce Solution Explorer Tree redraw madness
Dim isValid As Boolean
isValid = subitem.Name.LastIndexOf(".cs").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".sql").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".bcp").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".resx").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".ico").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".jpg").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".bmp").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".xml").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".wsdl").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".xsd").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".asmx").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".aspx").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".asax").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".xslt").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".localrunconfig").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".vsmdi").Equals(-1)
isValid = isValid And subitem.Name.LastIndexOf(".config").Equals(-1)
'isValid = isValid And subitem.Name.LastIndexOf("Properties").Equals(-1)
'isValid = isValid And subitem.Name.LastIndexOf("References").Equals(-1)

If (isValid And item.UIHierarchyItems.Expanded) Then
CollapseNode(subitem)
subitem.UIHierarchyItems.Expanded = False
'Fix for buggy Visual Studio on Projects located in folder inside a folder
If (subitem.UIHierarchyItems.Expanded.Equals(True)) Then
Dim UIHSolutionExplorer As UIHierarchy
UIHSolutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object()
subitem.Select(vsUISelectionType.vsUISelectionTypeSelect)
UIHSolutionExplorer.DoDefaultAction()
End If
End If
Next
End Sub

Sub CollapseAll()
' Get the the Solution Explorer tree
Dim UIHSolutionExplorer As UIHierarchy
UIHSolutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object()

' Check if there is any open solution
If (UIHSolutionExplorer.UIHierarchyItems.Count = 0) Then
Return
End If

' Get the top node (the name of the solution)
Dim UIHSolutionRootNode As UIHierarchyItem
UIHSolutionRootNode = UIHSolutionExplorer.UIHierarchyItems.Item(1)
CollapseNode(UIHSolutionRootNode)
' Select the solution node, or else when you click on the solution window
' scrollbar, it will synchronize the open document with the tree and pop
' out the corresponding node which is probably not what you want.
UIHSolutionRootNode.Select(vsUISelectionType.vsUISelectionTypeSelect)
End Sub

Tuesday, December 12, 2006

Libraries (scripting)

  • DHTML: http://msdn2.microsoft.com/en-us/library/ms533050.aspx
  • JScript: http://msdn2.microsoft.com/en-us/library/hbxc2t98.aspx
  • VBScript: http://msdn2.microsoft.com/en-us/library/t0aew7h6.aspx