Wednesday, June 1, 2016

Some useful URLs

ASP.NET Web API 2 using Entity Framework 6
http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1 

-----------------------------------------------------------------------------------------------------------------

Web API tutorials
http://www.asp.net/web-api/overview/web-api-routing-and-actions
-----------------------------------------------------------------------------------------------------------------

WIX

Wix Tutorial :- http://wix.tramontana.co.hu/
Example :- http://www.packtpub.com/article/windows-installer-xml-wix-adding-user-interface

--------------------------------------------------------------------------------------------------------------------
SOAP

SOAP UI tips and tricks : http://www.soapui.org/Scripting-Properties/tips-a-tricks.html
About groovy script:  http://www.soapui.org/userguide/functional/groovystep.html

--------------------------------------------------------------------------------------------------------------------
JSON.Net

http://james.newtonking.com/projects/json-net.aspx

--------------------------------------------------------------------------------------------------------------------
RESETful services with WCF

http://msdn.microsoft.com/en-us/magazine/dd315413.aspx

--------------------------------------------------------------------------------------------------------------------

WCF

WCF Exam - 70-513
http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-513&locale=en-us#tab2

Simple example to start with WCF
http://weblogs.asp.net/ralfw/archive/2007/04/14/a-truely-simple-example-to-get-started-with-wcf.aspx

Get started for free
http://msdn.microsoft.com/en-us/vstudio/aa496123
---------------------------------------------------------------------------------------
Introduction to Moq
http://code.google.com/p/moq/wiki/QuickStart

------------------------------------------------------------------------------------------

good link for GDI, GDI+, SharpDX


-----------------------------------------------------------------------------------------

leadtool - convert wicbitmap to GDI+ bitmap


--------------------------------------------------------------------------------------------

good example for endorsement


-----------------------------------------------------------------------------------------------

A good article for pub sub design pattern

Apart from link provided by Amit,
Below link is also good (same implementation)

fiddle present which I am referring: http://jsfiddle.net/eburley/N2yUF/

-------------------------------------------------------------------------------------------------------------

http://www.bennadel.com/blog/2807-using-rootscope-emit-as-a-performance-optimization-in-angularjs.htm
---------------------------------------------------------------------------------------------

Paging with sql server


-----------------------------------------------------------------------------------------------

dapper.net


------------------------------------------------------------------------------------------------------

wic get image format

http://forums.getpaint.net/index.php?/topic/25086-filetype-plugins-using-wic-codec/http://forums.getpaint.net/index.php?/topic/25086-filetype-plugins-using-wic-codec/

------------------------------------------------------------------------------------------------

memory leak
If you think you have a memory leak, then you should use a profiler to track it down. Three of the best tools are:
--------------------------------------------------------------------------------------------------------

List of accented chaaracters

ÁáÀàÂâÆæÇçÈèÉéÊêËëÍíÎîÏïÓóÔôŒœÚúÙùÛûÜü
abcÁáÀàÂâÆæÇçÈèÉéÊêËëÍíÎîÏïÓóÔôŒœÚúÙùÛûÜü
ÁáÀàÂâÆæÇçÈèÉéÊêËëÍíÎîÏïÓóÔôŒœÚúÙùÛûÜüabc
aÁáÀàÂâÆæÇçÈèÉéÊêËëÍíÎîÏïÓóÔôŒœÚúÙùÛûÜüb
!@#$ÁáÀàÂâÆæÇçÈèÉéÊêËëÍíÎîÏïÓóÔôŒœÚúÙùÛû
ÁáÀàÂâÆæÇç         ËëÍíÎîÏïÓóÔôŒœÚúÙùÛûÜ

-------------------------------------------------------------------------------------------

angularjs


-------------------------------------------------------------------------------------------------



Image.RawFormat is the better way, but just take a look on below


public enum ImageFormat
{
    Bmp,
    Jpeg,
    Gif,
    Tiff,
    Png,
    Unknown
}
 
public static ImageFormat GetImageFormat(byte[] bytes)
{
    // see http://www.mikekunz.com/image_file_header.html  
    var bmp    = Encoding.ASCII.GetBytes("BM");     // BMP
    var gif    = Encoding.ASCII.GetBytes("GIF");    // GIF
    var png    = new byte[] { 137, 80, 78, 71 };    // PNG
    var tiff   = new byte[] { 73, 73, 42 };         // TIFF
    var tiff2  = new byte[] { 77, 77, 42 };         // TIFF
    var jpeg   = new byte[] { 255, 216, 255, 224 }; // jpeg
    var jpeg2  = new byte[] { 255, 216, 255, 225 }; // jpeg canon
 
    if (bmp.SequenceEqual(bytes.Take(bmp.Length)))
        return ImageFormat.Bmp;
 
    if (gif.SequenceEqual(bytes.Take(gif.Length)))
        return ImageFormat.Gif;
 
    if (png.SequenceEqual(bytes.Take(png.Length)))
        return ImageFormat.Png;
 
    if (tiff.SequenceEqual(bytes.Take(tiff.Length)))
        return ImageFormat.Tiff;
 
    if (tiff2.SequenceEqual(bytes.Take(tiff2.Length)))
        return ImageFormat.Tiff;
 
    if (jpeg.SequenceEqual(bytes.Take(jpeg.Length)))
        return ImageFormat.Jpeg;
 
    if (jpeg2.SequenceEqual(bytes.Take(jpeg2.Length)))
        return ImageFormat.Jpeg;
 
    return ImageFormat.Unknown;
}


How to enable SQL Server Trace flags

First run query to check flag is enable or not. 

DBCC TRACESTATUS(-1)

Then execute below:-

DBCC TRACEON (1204,-1)
GO
DBCC TRACEON (4199,-1)
GO
DBCC TRACEON (2371,-1)
GO
DBCC TRACEON (3226,-1)
GO
DBCC TRACEON (1205,-1)
GO
DBCC TRACEON (1222,-1)
GO

Flag 1222 and 1204 are specially used to log deadlock errors.
Once you execute above query plz check current status to check that flags are enabled
DBCC TRACESTATUS(-1)