RSS

Monthly Archives: August 2011

The Imported Project “Microsoft.WebApplications.targets” Was Not Found

When trying to setup continuos integration with TFS (Team Foundation Server) build service, I get the following error:

Keep in mind that my development machine (from where I queue my build) is different than my TFS build machine.

So, there are two solution to this problem:

  1. Install Visual Studio 2010 (or the same version as in development machine) in your TFS server.
  2. Copy the “Microsoft.WebApplication.targets” from development machine file to TFS build machine.
The “Microsoft.WebApplications.targets” file is normally located under: “C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications”. The file will need to be copied to same path in TFS build machine.
Advertisements
 
Leave a comment

Posted by on August 29, 2011 in General

 

Tags: ,

Server.Transfer x Response.Redirect

Every web developer must have heard Response.Redirect, but not everybody has used Server.Transfer. Ok, that might be a wrong statement.

The point is, both Response.Redirect and Server.Transfer will send users to another page, what really are the differences? Here you go:

  1. Server.Transfer doesn’t actually redirect user’s browser.
    The transfer occurs on server’s side and do not first reach the client. So, calling Server.Transfer("about.aspx") from contact.aspx’s page load event will send user directly to about.aspx without round trip to the client.
  2. Server.Transfer can’t send users to external site other than yours.
    Since it occurs on server’s side, we can’t use it to transfer to external side other than our domain.
  3. Server.Transfer doesn’t change the original Url.
    Take an example above, when user requests contact.aspx, the server will return about.aspx content, however, the url will still be contact.aspx.
  4. Server.Transfer can also transfer form data and query strings.
    If there is any form data or query string in contact.aspx, it will also get transferred to about.aspx.
 
Leave a comment

Posted by on August 14, 2011 in General

 

Tags: , , ,

System.Uri Properties Result

In URL manipulation, System.Uri is necessary. Below are 3 examples of how a url translated to System.Uri properties:

https://stack247.wordpress.com/?s=stack
AbsolutePath = /
AbsoluteUri = https://stack247.wordpress.com/?s=stack
UserEscaped = stack247.wordpress.com
Fragment =
host = stack247.wordpress.com
HostNameType = Dns
LocalPath = /
OriginalString = https://stack247.wordpress.com/?s=stack
PathAndQuery = /?s=stack
UserEscaped = 80
Query = ?s=stack
Scheme = http
Segments[0] = /
UserEscaped = False
UserInfo =

https://stack247.wordpress.com/2011/03/02/stack/
AbsolutePath = /2011/03/02/stack/
AbsoluteUri = https://stack247.wordpress.com/2011/03/02/stack/
UserEscaped = stack247.wordpress.com
Fragment =
host = stack247.wordpress.com
HostNameType = Dns
LocalPath = /2011/03/02/stack/
OriginalString = https://stack247.wordpress.com/2011/03/02/stack/
PathAndQuery = /2011/03/02/stack/
UserEscaped = 80
Query =
Scheme = http
Segments[0] = /
Segments[1] = 2011/
Segments[2] = 03/
Segments[3] = 02/
Segments[4] = stack/
UserEscaped = False
UserInfo =

http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=stack+247
AbsolutePath = /search
AbsoluteUri = http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=stack+247
UserEscaped = www.google.com
Fragment =
host = www.google.com
HostNameType = Dns
LocalPath = /search
OriginalString = http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=stack+247
PathAndQuery = /search?sourceid=chrome&ie=UTF-8&q=stack+247
UserEscaped = 80
Query = ?sourceid=chrome&ie=UTF-8&q=stack+247
Scheme = http
Segments[0] = /
Segments[1] = search
UserEscaped = False
UserInfo =

 
Leave a comment

Posted by on August 13, 2011 in General

 

Tags: , ,

The How of an Idea

In my search of the next sliced bread (the probability is low, but at least I try to catch it!), I first search for the ‘how’ of sliced bread actually get defined. It’s all come down to an idea that people will like, accept and eventually use / consume it. So:

Why people will like and accept my idea?

  1. Because they need them (basic human’s needs).
  2. Because it solves existing problem.
    Solution to problems can target an individual, a group (niche market), or world (like in world peace). There will always be problems to be solved. Human race will never run out of problems.
  3. Because it yields better result.
    Better result could be more productive, save more time, higher ROI, less work, etc.
    Don’t get stuck with how you ‘normally’ perform certain activity. What you ‘normally’ doing is not always better of way doing it. That’s how the phrase ‘think out side the box’ came about, it’s to think out side your ‘normality’. Always challenge and be critical of existing ‘normality’ and think of a way to improve it.
  4. Because it triggers their mind to respond to stimuli or answer their fears.
    Napoleon Hill suggests there are 10 stimulis and 6 fears in which human mind responds to. People will like and accept my idea when it triggers their mind’s repsond through stimulis / fears.
  5. Because everybody else is using / doing it.
    Human nature is to conform to others. Whether we like it or not, we always conform to those who have stronger personality, forces or enthusiasm.
  6. Because it rewards them.
    Everybody likes reward, be it money, publicity / fame, relationship, self-actualization, riches (whatever the case might be). If the idea rewards them, they will go about using it.

However, for people to actually use / consume my realized-idea, they must have:

  1. Trust, can be achieved through:
    • Credibility: integrity and reliability of my realized-idea because of my previously proven track of record. Credibility gives a chance for others to believe in me.
    • Positive perspective: when one positively perceive my realized-idea, it will shape genuine, concrete and confident image towards my realized-idea. Thus, comes the trust.
    • Endorsement (from reliable sources): a form of affirmation or approval from higher sources, such as media, leaders, or significant others will build trust.
    • Crowd / conformity: again, conformity. If 85 out of 100 people consume / use my realized-idea, most likely the rest will follow. Why? ‘because everybody is doing it’.
 
Leave a comment

Posted by on August 13, 2011 in General

 

Tags: ,

FTP x FTPS x SFTP x Secure FTP x FTP over SSH

If you don’t know, there are many flavors of FTP, just like Doritos would have different flavors.

FTP

Regular file transfer protocol with no security whatsoever. Port is 21. The data transfer happens on 20.

FTPS

File transfer protocol using SSL connection. Authentication and data transfer are secured with SSL connection. Port is 990 with data transfer on 989.

SFTP

Not related to FTP at all. Just a mean of transferring files between network using SSH. Authentication and data transfer are secured with SSH. The protocol used is not FTP. Port is 22.

FTP over SSH (Secure FTP)

Also refers to “Secure FTP”, it’s a combination of SSH and FTP. Authentication is secured with SSH. However, data transfer is not secured, just like regular FTP. Port is 21.

An easy way to remember the differences is to remember that FTPS is using SSL just like HTTPS is. FTPS is the only secure file transfer defined in proposed standard: RFC 4217.

As usual, Wikipedia has it all!

 
Leave a comment

Posted by on August 7, 2011 in General

 

Tags: , ,

What is Persistence Ignorance?

In Entity Framework, Persistence Ignorance is defined as (MSDN):

An object that does not contain any logic that is related to data storage.

In his book “Applying Domain Driven Design and Patterns”, Jimmy Nilsson (also refers it as POCOs) defines as:

…ordinary classes where you focus on the business problem at hand without adding stuff for infrastructure-related reasons. … The classes should focus on the business problem at hand. Nothing else should be in the classes in the Domain Model.

Persistence ignorance object, or POCO, looks like this (notice there is no any constructor or method in this class):

public partial class Task
{
    public int Id { get; set; }
    public string Title { get; set; }
    public string Note { get; set; }
    public DateTime DueDate { get; set; }
    public DateTime EndDate { get; set; }
    public int PriorityId { get; set; }
    public int StatusId { get; set; }
    public int ResponsibilityId { get; set; }
}
 
1 Comment

Posted by on August 6, 2011 in General

 

Tags: , ,

SQL Server Execution Plan Definition 101

Heap Table:

A database table that doesn’t have clustered index. As opposed to clustered table.

Clustered Table:

A database table that has clustered index.

Non-clustered and Clustered:

Clustered index: index that stores the actual data.

Non-clustered index: a pointer to the data.

Refer to this post for more detail definition.

Table Scan:

Full scan, that is go and read through all of the data, in a table to find the rows that satisfy the query. Normally happen on table without any indices.

Clustered Index Scan:

Full scan in a clustered index table to find the rows that satisfy the query.

Non-clustered Index Scan:

Full scan in a non-clustered index table to find the rows that satisfy the query. Probably happens mostly in query that select all columns.

Clustered Index Seek:

Scan only on clustered index (as opposed to whole table).

Non-clustered Index Seek:

Scan only on non-clustered index (as opposed to whole table).

Key Lookup (Bookmark Lookup):

Happens when the query requests data from columns not present in the clustered index.

RID Lookup:

Happens when the query requests data from columns not present in the non-clustered index.

For understanding of some of these terms with example, this post by Greg Robidoux, “Understanding SQL Server Indexing” is very helpful.

 
Leave a comment

Posted by on August 6, 2011 in General

 

Tags: , , ,

 
%d bloggers like this: