Wednesday, 4 April 2012
Compatibility tables for support of HTML5, CSS3, SVG and more in desktop and mobile browsers.
http://caniuse.com/
Wednesday, 28 March 2012
Uses of content-disposition in an HTTP response header
Uses of content-disposition in an HTTP response header
// Download the file
Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
// Display the file in browser
Response.AppendHeader("content-disposition", "inline; filename=" + fileName);
Reference:
http://stackoverflow.com/questions/1012437/uses-of-content-disposition-in-an-http-response-header
// Download the file
Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
// Display the file in browser
Response.AppendHeader("content-disposition", "inline; filename=" + fileName);
Reference:
http://stackoverflow.com/questions/1012437/uses-of-content-disposition-in-an-http-response-header
Monday, 26 March 2012
Relative path with asp.net
The main part is to decide if it for the client side or server side which can be sometimes tricky.
Client side
A relative path that is resolved against the current page path.

A relative path that is resolved as a peer of the current page path.

Server side
ASP.NET includes the Web application root operator (~)
http://msdn.microsoft.com/en-us/library/ms178116(v=vs.90).aspx
Client side
A relative path that is resolved against the current page path.

A relative path that is resolved as a peer of the current page path.

Server side
ASP.NET includes the Web application root operator (~)
http://msdn.microsoft.com/en-us/library/ms178116(v=vs.90).aspx
Sunday, 25 March 2012
TFS Server 2010 with Business Intelligence Studio 2008
If you have upgraded to TFS Server 2010, connectivity from Visual Studio 2008 (shell for SQL Server Business Intelligence Studio 2008) has been a problem. Please follow the steps below in order to resolve this. Note that installation order is important. If you don’t have Team Explorer installed, step 3 will skip and compatibility pack will never install!
1. Install Visual Studio 2008, if it’s not already installed. If you are using BIDS studio 2008, you will have this installed already.
2. Install Team Explorer for Visual Studio 2008, if it’s not already installed http://www.microsoft.com/downloads/en/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&displaylang=en
3. Install Visual Studio 2008 Service Pack 1 http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=fbee1648-7106-44a7-9649-6d9f6d58056e&displayLang=en
4. Install Visual Studio 2008 TFS 2010 Forward Compatibility pack http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=cf13ea45-d17b-4edc-8e6c-6c5b208ec54d
If you encounter any issues, you may want to fix the registry as suggested in the blog – http://blog.jmedved.com/2009/11/visual-studio-2008-and-team-foundation.html
Ref: http://provizinc.wordpress.com/2010/10/08/tfs-server-2010-with-business-intelligence-studio-2008/
Once you install everything, you can try adding Team Foundation Server 2010 as destination, but you will be greeted with error “TF31002: Unable to connect to this Team Foundation Server …”. Reason behind this is that old Team Explorer 2008 does not know anything about collections.
Solution would be to add it as full path (e.g “http://server:8080/tfs/collection”). I could not do it because every time I entered full path, I also got error “TF30335: The server name cannot contain characters ‘/’ or ‘:’ …”. Since official way would not work it was time to come up with alternative.
In order to add TFS 2010 server, you will need to exit Visual Studio 2008 and go into Registry editor. Find key “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers” and at this location just add string value. Name of this value will be what Team Explorer 2008 will use for display. It’s value is full address of your server. It should be something like “http://server:8080/tfs/collection”.
Now you can go into Visual Studio 2008 and Team Explorer will have new entry. As you work with it, you will notice that not everything is “bump-free” (e.g. tasks). However, source control it self will work perfectly and that was enough for me.
Ref: http://www.jmedved.com/2009/11/visual-studio-2008-and-team-foundation-server-2010/
1. Install Visual Studio 2008, if it’s not already installed. If you are using BIDS studio 2008, you will have this installed already.
2. Install Team Explorer for Visual Studio 2008, if it’s not already installed http://www.microsoft.com/downloads/en/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&displaylang=en
3. Install Visual Studio 2008 Service Pack 1 http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=fbee1648-7106-44a7-9649-6d9f6d58056e&displayLang=en
4. Install Visual Studio 2008 TFS 2010 Forward Compatibility pack http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=cf13ea45-d17b-4edc-8e6c-6c5b208ec54d
If you encounter any issues, you may want to fix the registry as suggested in the blog – http://blog.jmedved.com/2009/11/visual-studio-2008-and-team-foundation.html
Ref: http://provizinc.wordpress.com/2010/10/08/tfs-server-2010-with-business-intelligence-studio-2008/
Once you install everything, you can try adding Team Foundation Server 2010 as destination, but you will be greeted with error “TF31002: Unable to connect to this Team Foundation Server …”. Reason behind this is that old Team Explorer 2008 does not know anything about collections.
Solution would be to add it as full path (e.g “http://server:8080/tfs/collection”). I could not do it because every time I entered full path, I also got error “TF30335: The server name cannot contain characters ‘/’ or ‘:’ …”. Since official way would not work it was time to come up with alternative.
In order to add TFS 2010 server, you will need to exit Visual Studio 2008 and go into Registry editor. Find key “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers” and at this location just add string value. Name of this value will be what Team Explorer 2008 will use for display. It’s value is full address of your server. It should be something like “http://server:8080/tfs/collection”.
Now you can go into Visual Studio 2008 and Team Explorer will have new entry. As you work with it, you will notice that not everything is “bump-free” (e.g. tasks). However, source control it self will work perfectly and that was enough for me.
Ref: http://www.jmedved.com/2009/11/visual-studio-2008-and-team-foundation-server-2010/
Indexer - Class member
Indexers are syntactic convenience that enable you to create a class, struct or interface that client application can accessed just as an array.
Static readonly vs const
The difference is that the value of a static readonly field is set at run time, and can thus be modified by the containing class, whereas the value of a const field is set to a compile time constant.
In the static readonly case, the containing class is allowed to modify it only
in the variable declaration (through a variable initializer)
in the static constructor (instance constructors, if it's not static)
http://blogs.msdn.com/b/csharpfaq/archive/2004/12/03/274791.aspx
Const values are burned directly into the call-site; this is double edged:
it is useless if the value is fetched at runtime, perhaps from config
if you change the value of a const, you need to rebuild all the clients
but it can be faster, as it avoids a method call...
...which might sometimes have been inlined by the JIT anyway
If the value will never change, then const is fine - Zero etc make reasonable consts ;-p Other than that, static properties are more common.
http://stackoverflow.com/questions/755685/c-static-readonly-vs-const
In the static readonly case, the containing class is allowed to modify it only
in the variable declaration (through a variable initializer)
in the static constructor (instance constructors, if it's not static)
http://blogs.msdn.com/b/csharpfaq/archive/2004/12/03/274791.aspx
Const values are burned directly into the call-site; this is double edged:
it is useless if the value is fetched at runtime, perhaps from config
if you change the value of a const, you need to rebuild all the clients
but it can be faster, as it avoids a method call...
...which might sometimes have been inlined by the JIT anyway
If the value will never change, then const is fine - Zero etc make reasonable consts ;-p Other than that, static properties are more common.
http://stackoverflow.com/questions/755685/c-static-readonly-vs-const
Wednesday, 21 March 2012
SQL IDENTITY_INSERT
SQL IDENTITY_INSERT is allow values to be inserted into the identity column of a table.
Identity column creates a numeric sequence value for you automatic.
It only allow one table in a session can have the IDENTITY_INSERT property set to ON.
If you need to change the table, you need to set the existing table IDENTITY_INSERT back to OFF.
SET IDENTITY_INSERT TableName OFF
If the value inserted is larger than the current identity value for the table, SQL Server automatically uses the new inserted value as the current identity value.
SET IDENTITY_INSERT TableName ON
http://sqltutorials.blogspot.co.nz/2008/04/sql-identityinsert.html
Identity column creates a numeric sequence value for you automatic.
It only allow one table in a session can have the IDENTITY_INSERT property set to ON.
If you need to change the table, you need to set the existing table IDENTITY_INSERT back to OFF.
SET IDENTITY_INSERT TableName OFF
If the value inserted is larger than the current identity value for the table, SQL Server automatically uses the new inserted value as the current identity value.
SET IDENTITY_INSERT TableName ON
http://sqltutorials.blogspot.co.nz/2008/04/sql-identityinsert.html
Subscribe to:
Posts (Atom)