Creating Understanding and Educating Programmers, Developers and Technical Communities, one post at a time.

Monday, December 7, 2009

Debug CSS

It is good idea to see the styles and HTML element's dimension in complex document by using Universal Selector.

Here is the code snippet.
*
{
border : 1px solid black;
}

Monday, November 30, 2009

Application Pool in IIS

It is good idea to create a new pool in IIS for each web application. Instead of putting all web application in one pool, creating of new pool will isolate each application. It will provide separate worker process. Let me know, if it is good for you.

Friday, October 30, 2009

How To Enable jQuery Intellisense in VS 2008

Here I want to share some valuable information on jQuery intellisense support in Visual Studio 2008.
Here are few steps which you need to follow.
  1. Make sure you already have SP1 for VS 2008. Otherwise you need to install it.
  2. Install patch KB958502 - JScript Editor support for “-vsdoc.js” IntelliSense files.
  3. Download the visual studio documentation from jQuery website.
Now drag downloaded documentation in your project and place it at same location where you have jQuery library. You will also notice that your downloaded documentation contain file name vsdoc2.js. In my case, I have jQuery library name jquery-1.3.2.js, when I downloaded jQuery documentation, that has jquery-1.3.2-vsdoc2.js, what I did, I removed 2 before dot. It became like jquery-1.3.2-vsdoc.js.

For more detail on jQuery subject, please visit Setting up Visual Studio Intellisense for jQuery.

Wednesday, October 21, 2009

ASP.NET Validation Controls

Once again, I am writing a very short blog post on ASP.NET validation controls. These are six validation controls. You can see them in following snapshot of toolbox wrapper.



Except ValidationSummary, all of the validation controls have following two common properties.
  • ControlToValidate: The ID of the form field being validatd.

  • Text: The error message displayed when validation fails.


Your suggestions and comments are always welcome, let me know so I can improve it.
AS a part of social networking campaign I have setup twitter account for programming360 blog. You can follow it @ http://twitter.com/Programming360

Tuesday, October 20, 2009

MSDN re-design

MSDN got new look. Several year it maintains its maroon color them. But, now it is using dark blue color, which is cool in my opinion. MSDN is ultimate resource for Microsoft platform developer. Earlier this year .Net logo was also changed to wave symbol with dark and light blue mixture of color. New re-design of MSDN library also follow the same color. It shows consistency in online business of Microsoft Corporate.

Friday, October 16, 2009

Page Execution Lifecycle

Here is the sequence of events that are raised whenever you request an ASP.NET page.
  • PreInit
  • Init
  • InitComplete
  • PreLoad
  • Load
  • LoadComplete
  • PreRender
  • PreRenderComplete
  • SaveStateComplete
  • Unload

Wednesday, October 7, 2009

Trilogy Stickers for Stackers

I got my Trilogy Stickers (League of Justice Stickers) three days ago, I immediately took a shot, so I can post it on Meta site of Stackoverflow. Stickers are cool and now I will paste them on my car, computer and router. Once I done with that, I will post some more pictures.

Thread was being aborted

I was working on project. Everything was fine but exception log showed "Thread was being aborted". I further looked into and found out System.Threading.ThreadAbortException:

It is because Response.Redirect and Server.Transfer methods take me to another page and call Response.End internally. Response.End immediately ends the page execution and shifts the execution to the Application_EndRequest event in the application's event pipeline. This make impossible to execute current page code.

You can avoid such exception by using overload method of Response.Redirect(string url, bool endResponse), and pass false value for second argument. It will suppress the interal call to Response.End.

You can use Server.Execute instead of Server.Transfer.

Thursday, October 1, 2009

Programming360 is now on Twitter

At this point when everybody (brand, companies, politicians etc ) is creating twitter. I also decide to adopt this new trend. Today, I am officially announcing twitter account for my Programming360 blog. You can follow Programming360 twit.

You could also subscribe Programming360 Twitter feeds.

Wednesday, September 30, 2009

Session Timeout

Session is always a most discussed topic in ASP.Net. Either you are beginner, intermediate or expert, you always play with them. If you don't know about the basic of session variable, please read my blog entry where I had wrote a very good quick and short tutorial on session variable (value assignment and retrieval).

Session Timeout is one of the most critical setting. It depends on the application requirement. You could set this property in Global.asax/Web.config. You can set session timeout in any one of them.

Web.config will use following setting. Look at the timeout attribute of sessionstate. You can set number of minutes. The default value is 20 minutes. You can set up to 1 year (525,600 minutes).

<configuration>
<system.web>
<sessionState cookieless="true" mode="InProc" timeout="1">
</sessionState>
</system.web>
</configuration>

Let me know, if blog entry about Session Timeout help you out to understand session concept. Your positive comments and questions are most welcome.

Monday, August 17, 2009

[Tool] Firebug

I like Firebug.
  • It is free.
  • It works best with FireFox.
  • It gives insight view of web page.
  • It allows me to evaluate inline code of javascript.

I am away from blogging for a while, therefore I am just writing a quick short post.

Friday, July 31, 2009

Session Vs Application Variable

Session Variables are those variable which only available to a single user. They are used to store/display single user information on website.

Application Variables are common to all user. These variables are used to configure application settings/other stuff.

Please read article, if you want to know more about Session.

Thursday, July 23, 2009

User Interface

User Interface (UI) is one of the major component of any user application. If UI is easy to understand then application also become more usable. I am impressed with Google's concept of application front end. They strictly follow KISS principle (keep it simple, stupid).


Anyways, Microsoft is also trying to create simplified UI like Windows Presentation Foundation (WPF) and adopting XAML format.

It seems that XML is not limited to structured data but also contributing in structured Interface designing. Here I would like to explain you that HTML and XAML are actually follow XML syntax rules.

Tuesday, July 7, 2009

SubForum.NET

Here is very good .Net Open Source Project called SubForum, initiated by Adnan Ahmad and Phillip Jacobs. Following are few details from the official website of SubForum.

Project Description
SubForum is a forum software built from scratch using ASP.NET MVC and AJAX to provide a rich Web 2.0 look and feel to a forum. The features include Search engine friendly URLs, Tags, Rich UI experience, and more.

live demo http://www.portaltoolbox.net

SubForum is a combination of a Forum, QA Site, Blog, Wiki, ScreenCast, and DIGG. The Forum can be used to launch a website on any particular topic and the users should be able to browse all the content related to the topic in the form of Discussions, Question and Answers, links to other blogs, etc. It will provide rich content site for any site owner targeting to run a site for their product or idea.

The UI will be much richer than the traditional forum sites where there is a Category, and then discussions or threads within a category. In SubForum users can post discussions or comments and provide Tags that will help searchers narrow down the posts by tags instead of categories only.

The forum will be Web 2.0 friendly. That means it will have search engine friendly URLs, logins for different login providers, Avatars, OpenID, etc. It will also have an easy to customize site layout that developers and designers can build against easily. The use of AJAX and jQuery will be used to provide a rich user interface for readers and posters and admins.

In summary SubForum will be a complete .NET based open source forum for anyone to use, beginning with .NET developers.
I am also keeping my eye on it and do my best. This project will allow me to learn new things, such as MVC.

You can download the latest code from subforum.net and contribute to project.


Reference:
http://subforum.net
http://wijix.com/post/SubForumnet-Is-An-Open-Source-ASPNET-MVC-Discussion-Forum.aspx

Monday, June 29, 2009

[Quotes] Debugging

“If debugging is the process of removing bugs, then programming must be the process of putting them in.”

- Edsger W. Dijkstra

Monday, June 22, 2009

ACID Properties

To ensure integrity of the data, we require that the database system maintain the following properties of the transactions(these properties are also called ACID properties of a transaction.)

Atomicity: Either all operations of the transaction are reflected properly in the database, or none are.

Consistency Execution of a transaction in isolation (that is, with no other transaction executing concurrently) preserves the consistency of the database.

Isolation Even though multiple transactions may execute concurrently. Each transaction is unaware of other transactions executing concurrently in the system.

Durability After a transactions completes successfully, the changes it has made to the database persist, even if there are system failures.

Saturday, June 20, 2009

ASP.NET developer categories

I was reading the ASP.NET developer categories. Writer describes the following three categories.
  • The web developer
  • The developer who build websites
  • The ASP.NET super hero

Thursday, June 18, 2009

Guest Writer on wijix.com

You have read my blog post here on programming360, but now I am also invited as guest writer on http://www.wijix.com/. So, you can also read my future posts on wijix blog.

Wijix.com is actually a group of independent technical writer. They are experienced architect and developer, who committed to bring and share innovative ideas and tips to the technical communities.

Some thoughts on Stored Procedure

I read Paul Nielsen post on stored procedure. According to him stored procedures are good for the applications. He is not only talking about logical or business process stored procedure, but he also encouraged developer for CRUD stored procedures. I think, it is good idea. There is no harm to use them. If database server have that capability, then why not CRUD stored procedures. Here I am quoting his valuable opinion.

The only real solution is an abstraction layer that fully encapsulates the database. Every database fetch, insert, and update must go through this access layer. Just as SOA provides this encapsulation for processes, the database needs the same black-box API. If the database team wants to refactor the database to improve some feature, it’s free to do so. If a new feature is added, the database team can add that feature and modify the API. It’s very clean, easy to refactor, and the database is now an on-ramp to the corporate roadmap.


If we look at the history of database development language, you will find either PL/SQL or T-SQL, these languages are not changed. As Paul made a cogent argument about T-SQL that it is still same for the stored procedure, which written decade ago.

I will appreciate you comments. Feel free to share your advice.

Tuesday, June 9, 2009

Data Access Layer Design Considerations

To help ensure that data access in your application is optimized for performance, there are several issues that you must consider and a number of decisions that you must make at design time:

  • Design your data access layer based on how the data is used.

  • Cache data to avoid unnecessary work.

  • Connect by using service accounts.

  • Acquire late, release early.

  • Close disposable resources.

  • Reduce round trips.

  • Return only the data you need.

  • Use Windows authentication.

  • Choose the appropriate transaction type.

  • Use stored procedures.

  • Prioritize performance, maintainability, and productivity when you choose how to pass data across layers.

  • Consider how to handle exceptions.

  • Use appropriate normalization.



Reference: http://msdn.microsoft.com/en-us/library/ms998569.aspx

Tuesday, June 2, 2009

Extension Methods

Extension Methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type.

I found a very good tutorial on Extension Method.

Friday, May 29, 2009

[Quick Tip] Session

During the development of Asp.Net application, developer don't need to instantiate any session. Session is automatically instantiated, you need to use them according to your requirement. Here, I am going to show you one simple example.

DataTable dt = new DataTable();

// what ever the table you want to put in dt

// assign dt value into session variable, make sure it is unique name,
// I have given dtSessionVariable as session variable name.
Session["dtSessionVariable"] = dt;


// To retrieve it from session, it require casting back to original type
DataTable dt = (DataTable)Session["dtSessionVariable"];

Monday, May 18, 2009

Friday, May 15, 2009

Structure

Structure is a lightweight class in C#. The following list details the differences between structures and classes.

Structure
  • implicity inherits from System.ValueType (always reside on stack)
  • are sealed and can not be inherited, and also cannot inherit classes and other structures
  • The default constructor of a structure cannot be replaced by a custom constructor.
  • Custom constructors of a structure must fully initialize the value of the structure.
  • Dont have a destructor
  • Field initialization is not allowed. Const members of a structure can be initialized.

Thursday, May 14, 2009

Global.asax

The Global.asax file(the ASP.NET application file) contains code for responding to application-level and session-level events raised by ASP.NET or by HTTP modules.

By default, the ASP.NET Framework maintains a pool of HttpApplication objects to service incoming page requests. A separate HttpApplication instance is assigned to each request.

If you prefer, you can create a custom HttpApplication class. That way, an instance of your custom class is assigned to each page request.

You can create custom properties in your derived class. These properties can be accessed from any page, control, or component. You also can handle any application events in your custom HttpApplication class.

You create a custom HttpApplication class by creating a special file named Global.asax in the root of your application. Following are few more detail about it.

  • It is optional file.
  • It must be located in the root directory. (file located in sub-directory is simply ignored)
  • Only one global.asax file per application. (you can not have more than one for an application.)
Example:

public class Global: System.Web.HttpApplication
{
//It is derived from HttpApplication base class

protected void Application_Start(Object sender, EventArgs e)
{
//lush(good) code
}
}

Sunday, May 10, 2009

void pointer

Pointer to void (void *) is a generic pointer capable of representing any pointer type. All pointer types can be assigned a pointer to void without casting. However, a pointer to void cannot be assigned directly to a pointer of another type - the void pointer must first be cast to proper pointer type.

A void * pointer can not be dereferenced.

Wednesday, April 22, 2009

Software Engineering and Ethics

Software is the core for any computer–based system, which affect all aspects of our life. Software development is a complex, expensive, and ethical engineering task which requires qualified SWE professionals. Ethical and professional principles for software engineering professionals were adopted by professional committees such as IEEE and ACM.

In software engineering; there are several problems related to ethical issues. These issues include: professional responsibilities, social responsibility, quality as moral issue, software ownership and intellectual property rights, privacy, computer crimes, confidentiality, responsibility and liability, professional competence, impact on society and work place, security and reliability, and safety.

You should not use your skills and abilities to behave in a dishonest way or in a way that will bring disrepute to the software engineering profession. However, there are areas where standards of acceptable behavior are not bounded by laws but by the more tenuous notion of professional responsibility. Some of these are:

  • Confidentiality: You should normally respect the confidence of your employers or clients irrespective of whether a formal confidentiality agreement.
  • Competence: You should not misrepresent your level of competence. You should not knowingly accept work that is outside your competence.
  • Intellectual property rights: You should be aware of local laws governing the use of intellectual property such as patents and copyright. You should be careful to ensure that the intellectual property of employers and clients is protected.
  • Computer misuse: You should not use any technical skills to misuse other people’s computers.Computer misuse ranges from relatively trivial (game playing on an employer’s machine, say) to extremely serious (dissemination of viruses).
Software engineering is still a young field. In this regard software engineers should supportive of their colleague and provide good environment where they can grow and learn. Lead software engineer should also know about their competence areas. They also have to follow policies and procedure which established by technical communities.

References:
  • Software Engineering Code of Ethics and Professional Practice (ACM/IEEE-CS)
    http://www.acm.org/about/se-code
  • Software Engineering by Ian Sommerville, 8th Ed.

Saturday, April 18, 2009

System.Object

All .Net types are derived from System.Object. Therefore every object of every type has a minimum set of method from System.Object class.
More specifically, System.Object offers following public methods.
  • Equals
  • GetHashCode
  • ToString
  • GetType

Moreover, it also allow access to protected methods.
  • MemberwiseClone
  • Finalize

Tuesday, April 7, 2009

What Causes Application Restart

ASP.net run-time environment implements a good deal of checks and automatically restarts an application if any of the following scenarios occur:
  • The maximum limit of dynamic page compilations is reached.
  • The physical path of the Web application has changed, or any directory under the Web application folder is renamed.
  • Changes occurred in global.asax, machine.config or web.config in the application root, or in the Bin directory or any of its subdirectories.
  • Changes occurred in the code-access security policy file, if one exists.
  • Too many files are changed in one of the content directories. (Typically, this happens if files are generated on the fly when requested.)
  • Changes occurred to settings that control the restart/shutdown of the ASP.NET worker process. These settings are read from machine.config if you don't use Windows 2003 Server with the IIS 6.0 process model. If you're talking full advantage of IIS 6.0, an application is restarted if you modify properties in the Application Pools node of the IIS manager.

Friday, April 3, 2009

ISAPI Filter

ISAPI filters are DLL files that can be used to modify and enhance the functionality provided by IIS. ISAPI filters always run on an IIS server, filtering every request until they find one they need to process. The ability to examine and modify both incoming and outgoing streams of data makes ISAPI filters powerful and flexible.

Comment will be answered quickly to the reader of this post...
;)

Sunday, January 25, 2009

Usage/Power of Boolean

Title of this post is strange to others. When I say power of Boolean, it does not mean any mathematical term, but to some extent it is. Actually, every-thing is based upon bool type.

Our daily life is also using this type. Every person or majority of people use bool efficiently. I am not talking about their end result/product. I am talking about usage of bool type.

What do you think about this type?
Do you have any other thought for this type?

Just answer my questions in comment area.