Google Brother Up

2009/04/28

Difference between Mutable & Immutable objects

The difference between mutable and immutable objects is that, string buffer is a mutable string object, where as a string is a non-mutable object. Mutable basically means changeable any time.


In object-oriented computer programming an immutable object basically is an object which cannot be customized after it is formed. This is opposition to a mutable object, which can be customized after is formed. A particular object can either be completely immutable or a certain attributes in that particular object may be acknowledged as immutable, like applying the const element data attribute in the C++ programming language.


In certain cases, an article is thought to be immutable even while certain internally applied attributes modify but the object's state come into view as unchanging from and peripheral point of view.

315 unique visitors

Some Interview Question Answers (Part 002)

1. Which is one of the access modifiers in .NET?

Public, Protecte, Private, Internal


2. What does GAC stand for in .NET?

Global Assembly Cache


3. Which object contains its items in key/value pairs?

Sorted List and Hash Tables


4. Structures do not support inheritance, while Classes support it.

true


5. If AutoGenerateColumns property is set to True and custom column definitions are still provided, GridView will render both of them.

true


6. What is the property name of a GridView (or a DataGrid) that regulates the sorting?

AllowSorting = true


7. A single .NET dll can contain 1024 classes at most.

false


8. ADO.NET is entirely based on XML.

true


9. Which is one of the authentication types in .NET?

Passport Authentication


10. What is the extension of a Web User Control?

ascx

313 unique visitors

Some Interview Question Answers (Part 001)

1. What is the lifespan for the information stored in a ViewState?

Exists for the life of the current page


2. What section of a Web.Config is used to store a list of authorized users?

Authentication


3. Which object contains the user name in an ASP.NET form page?

Page.User.Identity


4. Which one is triggered first in an ASPX page cycle?

Init


5. What is the top .NET class that everything is derived from?

System.Object


6. Literal control always encloses its text value with SPAN tags.

false


7. Which one of the following statements is false?

Arrays can be changed in size at runtime without ReDim.


8. ASP.NET still recognizes the global.asa file.

false


9. What is the default Session Timeout?

20 minutes


10. C# supports multiple inheritance by using classes.

false

313 unique visitors

2009/04/13

Differences between nvarchar and varchar in SQL Server

SQL Server provides both datatypes to store character information. For the most part the two datatypes are identical in how you would work with them within SQL Server or from an application.

The difference is that nvarchar is used to store unicode data, which is used to store multilingual data in your database tables. Other languages have an extended set of character codes that need to be saved and this datatype allows for this extension. If your database will not be storing multilingual data you should use the varchar datatype instead. The reason for this is that nvarchar takes twice as much space as varchar, this is because of the need to store the extended character codes for other languages.

271 unique visitors

2009/04/06

Cross-Site Scripting & Remediation Action

Cross-Site Scripting
Cross-site scripting is a term used to describe problems which arise when maliciously crafted user data causes a web application to redirect an unsuspecting web browser to an undesired site. It was possible to send strings with special HTML characters ( < > " ' ) to your web application, and see them rendered in the response. Since these characters were not encoded by the web application, it may be possible to inject HTML scripting code into the rendered page. The injections can occur in your HTML body, Title, Scripting, or even commented out portions of the document. Note: Due to the potential negative impact on this web server's resources that could result from attacking a large number of cross-site scripting attack vectors, TrustKeeper abandons this test after it has found at least three instances where user input is not being properly sanitized. Therefore, it is possible that the reported findings associated with this vulnerability are only a subset of all possible attack vectors.

Remediation Action
This is a generic warning based on a test that indicates that your web application may not validate user-provided input, such as that provided by a form. Review your web application to ensure that user data is checked on the server side of the application (NOT in the web browser) for proper length and character content. It is recommended that a white-list of acceptable characters be used, with all other characters being HTML encoded prior to being sent in response to the client. Review the "Cross-Site Scripting", "Data Validation", and "Review Code for Cross-site scripting" pages on OWASP.org (see the reference links in this finding).

256 unique visitors

C# Code to Dynamically Change Title of a Page

C# Code to Dynamically Change Title of a Page: -


[title]My Website - [%=Request.QueryString["Mode"]%] form[/title]

* Replace the [ by <>

256 unique visitors

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx