Posts

Showing posts from May, 2015

Difference between array, arraylist, List, Hashtable, Dictionary and SortedList in c#

Basic difference is that arrays are of fixed size. Whereas an ArrayList implements the list data structure and can dynamically grow. While arrays would be more performance that a list, a list would be far more flexible since you don't need to know the required size initially. Array - represents an old-school memory array - kind of like a alias for a normal type[] array. Can enumerate. Can't grow automatically. I would assume very fast insertion, retrieve and speed. ArrayList - automatically growing array. Adds more overhead. Can enum., probably slower than a normal array but still pretty fast. These are used a lot in .NET List - one of my favorites - can be used with generics, so you can have a strongly typed array, e.g. List . Other than that, acts very much like ArrayList. Hashtable - plain old hashtable. O(1) to O(n) worst case. Can enumerate the value and keys properties, and do key/val pairs. Dictionary - same as above only strongly typed via generics, such a...

What is the difference between an ID selector and CLASS?

An ID selector identifies and sets style to only one occurrence of an element, while CLASS can be attached to any number of elements.

What is a class? What is an ID?

A class is a style (i.e., a group of CSS attributes) that can be applied to one or more HTML elements. This means it can apply to instances of the same element or instances of different elements to which the same style can be attached. Classes are defined in CSS using a period followed by the class name. It is applied to an HTML element via the class attribute and the class name. The following snippet shows a class defined, and then it being applied to an HTML DIV element.  .test {font-family: Helvetica; font-size: 20; background: black;} Also, you could define a style for all elements with a defined class. This is demonstrated with the following code that selects all P elements with the column class specified.   p.column {font-color: black;}  An ID selector is a name assigned to a specific style. In turn, it can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name. The foll...

How do CSS precedence/cascading rules work? How does the !important directive affect the rules?

CSS style rules “cascade” in the sense that they follow an order of precedence. Global style rules apply first to HTML elements, and local style rules override them. For example, a style defined in a style element in a webpage overrides a style defined in an external style sheet. Similarly, an inline style that is defined in an HTML element in the page overrides any styles that are defined for that same element elsewhere.  The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important property will always be applied no matter where that rule appears in the CSS document. So if you wanted to make sure that a property always applied, you would add the !important property to the tag. So, to make the paragraph text always red, in the above example, you would write:  p { color: #ff0000 !important; }

What are different ways to apply styles to a Web page

There are four ways to apply style to a Web page.   Inline CSS: HTML elements may have CSS applied to them via the STYLE attribute.You can always check HTML, CSS and JavaScript code impact using Online HTML Javascript editor. <p style=”font-size: 12px; color: #000000;”>Test </p> Embedded CSS: CSS may be embedded in a Web page by placing the code in a STYLE element within the HEAD element.For Example: If You have element into webpage, you can apply embedded style like shows in example. <head> <style type=”text/css”> h2 { font-size: 16px; color: #2d2d2d; font-weight: 900; } </style> </head> Linked CSS : CSS can be placed in an external file (a simple text file containing         CSS) and linked via the link element.You can apply style to webpage using external file as shown in example. <link rel=”stylesheet” href=”custom/custom.css” type=”text/css” media=”screen, projection” /> Import...

What are advantages of HTML5?

a) Cleaner markup than earlier versions of HTML b) Additional semantics of new elements like     Header, nav, and time c) New form input types and attributes that will (and in Opera’s case, do) take the hassle out of            scripting forms.

Difference between HTML and HTML5 ?

HTML5 is nothing more then upgraded version of HTML where in HTML5 supports the innovative features such as Video, Audio/mp3, date select function , placeholder , Canvas, 2D/3D Graphics, Local SQL Database added so that no need to do external plugin like Flash player or other library elemenents

What is the major improvement with HTML5 in reference to Flash?

Flash is not supported by major mobile devices such as iPad, iPhone and universal android applications. Those mobile devices have lack of support for installing flash plugins. HTML5 is supported by all the devices, apps and browser including Apple and Android products. Compared to Flash, HTML5 is very secured and protected. That eliminates major concerns that we have seen with Flash.

What is the purpose of HTML5 versus XHTML?

HTML5 is the next version of HTML 4.01, XHTML 1.0 and DOM Level 2 HTML. It aims to reduce the need for proprietary plug-in- based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, Apache Pivot, and Sun JavaFX. Instead of using those plugins, it enables browser to serve elements such as video and audio without any additional requirements on the client machine.