Monday, 1 March 2010

WCF: svclog viewer SvcTraceViewer.exe

Fire up SvcTraceViewer.exe located under:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin

OR just run via your VS console window and type in "svctraceviewer"

VS2008: The breakpoint will not currently be hit. No symbols have been loaded for this document.

My VS instance crashed while I was trying to add a WCF service. Had to terminate the process. But when I restarted, I noticed strange behaviours with the IDE. I could no longer debug my project and would receive an error stating that "The breakpoint will not currently be hit. No symbols have been loaded for this document."

A bit of googling found this article.

The solution for me was to:

1. start debug
2. ctrl+alt+u.
3. Look for project in list and note path.
4. Close VS.
5. In explorer navigate to cache location in step 3, delete location of the cache usually under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\xxx
I just deleted everything in root.
6. Deleted both bin and obj folder of each project.
6. Restart VS
7. Rebuild




Monday, 18 January 2010

TSQL: Order by Null OR zero first

The snippet below will order your values with any values as NULL or Zero first.

SELECT event_ID, event_title, event_date
FROM table_events
ORDER BY case when event_date is null or event_date = 0 then 1 else 2 end, event_date DESC

If you use union, you'll need to wrap your union statement within another SELECT before you can use the ORDER BY CASE statement above.

For example:

SELECT *
FROM
(
SELECT A, B, C
FROM Table1
UNION
SELECT X, Y, Z
FROM Table2
) X
ORDER BY A, B, C

Friday, 15 January 2010

Markdown: Simplifying HTML

This is an interesting concept, simplifying HTML so you can markup a document as easily as typing up a word document.

Wednesday, 23 December 2009

TSQL: Granting Permissions

GRANT INSERT ON table
TO sqluser
GO

GRANT UPDATE ON table
TO sqluser
GO

SQL Profiler: Wild Cards

When adding wild cards to filter by textdata column, be sure to include the percentage characters around your text string.

For example:

%WHERE bass = null%

Friday, 18 December 2009

TSQL: Newline, Carraige returns into char or varcahr field

To insert new line + carraige returns (\r\n) into a char or a varchar field you'll need to convert the to char(13)+char(10) before running your UPDATES or INSERTS.

Tuesday, 15 December 2009

Sysadmin: cURL

Found a very powerful commandline tool for transferring data across a multitude of protocols.
"curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction."
http://curl.haxx.se/

Adobe AIR: Getting Started

Adobe AIR
" Adobe AIR is a cross-operating system runtime that enables you to use your existing HTML/Ajax, Flex, or Flash web development skills and tools to build and deploy rich Internet applications to the desktop.

Adobe AIR applications support native desktop integration, including clipboard and drag-and-drop support, local file IO, system notification, and more. " - http://www.adobe.com/devnet/air/

Essentially, AIR allows you to easily package up your browser based web application created in HTML/AJAX/Flash/Flex and deploy it to clients as a desktop application.

Getting Started

To start you'll need to download the Adobe AIR SDK. The SDK is available from Adobe's website. The SDK contains the necessary javascript libraries and also a debugger, packaging utility for creation of installation files AND self-signed certificate generator. There is no IDE that comes with the SDK. Current version is 1.5.3

For an IDE you can use any text editor, but if you wish to have a GUI interface, the options are to use Aptana Studio or Adobe Dreaweaver CS3/CS4 with Adobe Air Extensions for Dreamweaver.

A step by step guide to writing your first Hello World AIR application using any text editor can be found here.

http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7ecc.html

Interesting

Wednesday, 9 December 2009

JQUERY: Get select value and text

Get Value:

$('#selectList').val();

Get Text:

$('#selectList :selected').text()

Get Multiple Text:

var foo = [];
$('#multiple :selected').each(function(i, selected){
foo[i] = $(selected).text();
});