Wednesday, July 20, 2011

What is Windows Presentation Foundation

The Windows Presentation Foundation is Microsoft’s next generation UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher.

  • WPF is also known as ”AVALON”.
  • WPF supports Rich User interface programming.
  • WPF supports :-
    1. To work with colors.
    2. To work with transformations.
    3. To develop Animations.
    4. To work with Brushes etc…
  • WPF puts forward a new set of classes and assemblies which allows us to write programs more efficiently and flexibly.
  • WPF combines application UI’s,2D graphics,3D graphics, documents and multimedia into one single framework. This makes UI faster, scalable and resolution independent.

Types of Tools

  • Microsoft provides two development tools for WPF applications.

1. Visual Studio. ( For Developers)

2. Expression Blend. ( For Designers )

  • Visual studio is the tool for developers to develop WPF and is good in code & XAML editing. It has a rare support for all the graphical stuff like gradients, template editing, animation etc.
  • Expression Blend is the tool for designers, that covers the graphical part very well but it has (still) rare support for code & XAML editing.

ARCHITECTURE of WPF


WPF is actually a set of assemblies that build up the entire framework. These assemblies can be categorized as

  • Managed Layer
  • UnManaged Layer
  • Core API
  1. Managed Layer : Managed layer of WPF is built using a number of assemblies. These assemblies build up the WPF framework, communicates with lower level unmanaged API to render its content. The few assemblies that comprise the WPF framework are :
    • PresentationFramework.dll : Creates the top level elements like layout panels, controls, windows, styles etc.
    • PresentationCore.dll : It holds base types such as UIElement, Visual from which all shapes and controls are Derived in PresentationFramework.dll. 
    • WindowsBase.dll : They hold even more basic elements which are capable to be used outside the WPF environment like Dispatcher object, Dependency Objects. 
  2. Unmanaged Layer (milcore.dll):  The unmanaged layer of WPF is called milcore / Media Integration Library Core. It basically translates the WPF higher level objects like layout panels, buttons, animation etc into textures that Direct3D expects.  It is the main rendering engine of WPF.
    • WindowsCodecs.dll : This is another low level API which is used for imaging support in WPF applications. WindowsCodecs.dll comprises of a number of codecs which encodes / decodes images into vector graphics that would be rendered into WPF screen.
  3. Direct3D : It is the low level API in which the graphics of WPF is rendered.
  4. User32 : It is the primary core API which every program uses. It actually manages memory and process separation.
  5. GDI & Device Drivers : GDI and Device Drivers are specific to the operating system which is also used from the application to access low level APIs.

XAML

  • XAML stands for Extensible Application Markup Language.
  • Its a simple language based on XML to create and initialize .NET objects with hierarchical relations.
  • XAML is a case-sensitive and also called as Structured language.
  • XAML is  a collection of predefined tags.

Advantages of XAML

  • XAML code is short and clear to read.
  • Separation of designer code and logic.
  • Graphical design tools like Expression Blend require XAML as source.
  • The separation of XAML and UI logic allows it to clearly separate the roles of designer and developer.

Namespaces of XAML

The mapping between an XML namespace and a CLR namespace is done by the XmlnsDefinition attribute at assembly level. You can also directly include a CLR namespace in XAML by using the clr-namespace: prefix.

Disadavantages of WPF

  1. WPF's in-box control suite is far more limited than that of WinForms.
  2.  There's greater support in the 3rd-party control space for WinForms. (That's changing, but for now by advantage of time, WinForms has greater support in the community.
  3. Most developers already know WinForms; WPF provides  a new learning curve.

WPF will not run on windows 2000 or lower.

Below are the differences between WPF & WINFORMS.

WPF (VS) WINFORMS

WPF

+ Powerful styling and skinning structure

+ Easy to create an own Look and Feel

+ Does support Windows Forms

+ The future technology for developing Vista Applications

+ The ability to reuse existing code

+ Highly advanced data binding possible

- Declarative vs. procedural code

- Requires .NET Framework 3.0

- Compared to Windows Forms, still in development phase

- Requires Dx9 compatible vidcard for advanced graphics

Windows Form

+ Extensive documentation to be found on the internet

+ Plenty of examples

+ Does support WPF

- How long will this be supported? (I've read somewhere that Microsoft is only developing WPF now, only maintenance for Winforms)

- Design your own look and feel in a application is a lot of work.

Tuesday, April 19, 2011

Normalization

Normalization

Normalization is the process of efficiently organizing data in a database.
"Normalization" refers to the process of creating an efficient, reliable, flexible, and appropriate "relational" structure for storing information.

Goals:

  1. Eliminating redundant data.
  2. Ensuring data dependencies make sense. (only storing related data in a table).

Advantages:

  1. Cures the ‘SpreadSheet Syndrome’.
  2. Store only the minimal amount of information.
  3. Remove redundancies.
  4. Restructure Data.
  5. Decreased storage requirements.
  6. Faster search performance.
  7. Improved data integrity.

Types:

A series of logical steps to take to normalize data tables.
  1. First Normal Form (1NF)
  2. Second Normal Form (2NF)
  3. Third Normal Form (3NF)
  4. Boyce-Codd Normal Form (BCNF)
  5. Fourth Normal Form (4NF)
  6. Fifth Normal Form (5NF)
& many more(not in use).

First Normal Form

A table is considered to be in 1NF if all the fields contain only scalar values . i.e; All columns (fields) must be atomic : no repeating items in columns.
Here, Ord no & date are non-atomic attributes,(Not in 1 NF).
Non-atomic attributes are eliminited by filling with atomic values where there are non-atomic values are present.

First Normal Form Decomposition

  1. Place all items that appear in the repeating group in a new table.
  2. Each row must be unique - Designate a primary key for each new table produced.
  3. Duplicate in the new table the primary key of the table from which the repeating group was extracted or vice versa.
Before learning about ,You must be aware of Functional dependencies

Functional Dependencies:

If one set of attributes in a table determines another set of attributes in the table, then the second set of attributes is said to be functionally dependent on the first set of attributes.
Ex: Table Scheme: {ISBN, Title, Price}
Functional Dependencies: {ISBN}  {Title}
{ISBN}  {Price}

Second Normal Form

For a table to be in 2NF, there are two requirements
  1. If a data item is fully functionally dependent on only a part of the primary key, move that data item and that part of the primary key to a new table.
  2. If a data item is fully functionally dependent on only a part of the primary key, move that data item and that part of the primary key to a new table.
  3. If other data items are functionally dependent on the same part of the key, place them in the new table also.
Let us consider the above table
Let x={ ord no.,prod no.} -> y={date}, {prod name}, {Qty}, {U. price}.

Therexists, z ={ord no.} c x -> {date}

Therexists, z ={prod no.} c x -> {prod name}

This suffers from functional dependencies.
  1. To convert this relation into 2 NF, we must eliminate the partial functional dependencies by decomposing the relation into several no. of relations.
  2. We must create a separate relations for the attributes which causes the partial functional dependencies.

Third Normal Form

A relation R is in third normal form (3NF) if and only if it is in 2NF and every non-key attribute is non-transitively dependent on the primary key. An attribute C is transitively dependent on attribute A if there exists an attribute B such that: A ® B and B ® C.
Steps to convert 2 NF into 3 NF : we have unitCode as our primary key, we also have a courseName that is dependent on courseCode and courseCode, dependent on unitCode. Though couseName could be dependent on unitCode it more dependent on courseCode, therefore it is transitively dependent on unitCode.

BCNF (Boyce - Codd Normal Form)

A relation schema R is in BCNF if for every set of attributes
X in R and attribute A in R, X is a superkey whenever X A.
--- no attribute is transitively dependent on a key

R1=(Prof, S#) K1=(Prof S#)

R2=(Prof, C#) K2=(Prof)

--- R1 and R2 are both in BCNF

Fourth Normal Form

To be in Fourth Normal Form, a relation must first be in Boyce-Codd Normal Form. Additionally, a given relation may not contain more than one multivalued dependency.

Fifth Normal Form

A table is in fifth normal form (5NF) or Project-Join Normal Form (PJNF) if it is in 4NF and it cannot have a lossless decomposition into any number of smaller tables.

DKNF

The relation is in DKNF when there can be no insertion or deletion anomalies in the database.

Friday, April 8, 2011

QR Codes

QR CODES

The QR code [ QUICK RESPONSE CODE ]was a kind of two dimensional symbology, and the DENSO WAVE (a division of Denso Corporation, Japan at the time) and released in 1994 with the primary aim of being a symbol that is easily interpreted by scanner equipment.

QR Code (2D Code) contains information in both the vertical and horizontal directions, whereas a bar code contains data in one direction only. QR code can carry up to several hundred times the amount of data carried by an ordinary bar codes.(QR Code holds a considerably greater volume of information than a bar code.)

QR Codes features

1.High capacity Encoding of Data - While conventional bar codes are capable of storing a maximum of approximately 20 digits, QR Code is capable of handling several dozen to several hundred times more information.

QR Code is capable of handling all types of data, such as numeric and alphabetic characters, Kanji, Kana, Hiragana, symbols, binary, and control codes. Up to 7,089 characters can be encoded in one symbol.

QR Code Data Capacity :

Numeric -only Max. 7,089 characters

Alphanumeric- Max. 4,296 characters

Binary -(8 bits) Max. 2,953 bytes

Kanji- full-width

Kana -Max. 1,817 characters

2.Small Printout Size - QR Code is capable of encoding the same amount of data in approximately one-tenth the space of a traditional bar code. (For a smaller printout size, Micro QR Code is available.

3.Kanji and Kana Capability - As a symbology developed in Japan, QR Code is capable of encoding JIS Level 1 and Level 2 kanji character set.
In case of Japanese, one full-width Kana or Kanji character is efficiently encoded in 13 bits, allowing QR Code to hold more than 20% data than other 2D symbologies.

4.Dirt and Damage Resistant- QR Code has error correction capability. Data can be restored even if the symbol is partially dirty or damaged.

5.Readable from any direction in 360°- QR Code is capable of 360 degree (omni-directional), high speed reading. QR Code accomplishes this task through position detection patterns located at the three corners of the symbol. These position detection patterns guarantee stable high-speed reading, circumventing the negative effects of background interference.

6.Structured Append Feature –QR Code can be divided into multiple data areas. One data symbol can be divided into up to 16 symbols, allowing printing in a narrow area.

Where are QR codes being used?

QR codes can be used in our business in a number of ways.QR codes are being used on product packaging, magazine articles and ads, ads on buses, museum exhibits, and business cards:

  • Product details
  • Contact details
  • Offer details
  • Event details
  • Competition details
  • A coupon
  • Twitter, Facebook, MySpace IDs
  • A link to your YouTube video

QR Codes are beginning to catch on here in the United States.

How will Google see them?

If you add QR codes to your website, the search engines will see that your pages have changed, and that you are updating pages. The search engine will see a new image and index it accordingly. At some point soon, the search engines will likely recognize QR codes and possibly index the content in them.

Customized QR Codes

Directly from the dashboard page of Google Places account, businesses can download a QR code that is unique to their business. Customers with smart phones can scan Google Customized QR code and see the mobile version of the place page.

QR (vs) SEO & SEM :

QR Codes are a very cool tool to use in Search Marketing

The use of QR codes becomes a bit more ubiquitous, the SEO and SEM implications for using them are going to be up in the air. The game-changing reality of the mobile internet is going to have a radical impact on how sites make money in the future, and QR codes may very well be the bridge between print and digital that keeps your brand in the viewer’s mind.

This also creates one incoming link, to any URL of your choice, including your Ecommerce, main website, or whatever URL you want to use. Which would help you out in regards to SEO to your website …

While SEO implications and practices are not completely ironed out, there are many benefits. As QR Codes are backlinks, the benefits at the very less.
But, it seems Google will start recognizing and caching QR Codes and separate directories for these types of links will begin cropping up.

QR codes will begin to provide a link between SEO and the older forms of marketing like newspaper ads, billboards, posters, etc. Suddenly, these seemingly antiquated forms of marketing can be used to drive traffic to your website. And better yet, that traffic will be trackable.

Thus, as the number of smart-phone users, and the number QR Codes continues to grow, so does their importance for SEO. Who knows, in the near future, an SEO Company might have to include QR Optimized Business Cards, Newspaper Ads and Billboards in their proposals.

The potential benefit of these QR codes is clear but what is also clear it that any successful company needs an SEO expert as a partner and resource to navigate the rapidly changing landscape of online and digital marketing and the rapid adoption of new technologies.

Monday, March 7, 2011

Know DNN

1 BLOG IN DNN:

DotNetNuke  is a powerful and flexible content management system for building websites. It comes with many features for publishing content including tools to create Blogs, Banner Advertising, News Feeds, and much more. All of this comes right out of the box and if you use the Community Edition, all of it is free.

If you are building a website, the web server and database server are two different machines located on the network. To install and run DNN you need login access to each machine with privileges to install software.

Internet access is necessary to download the DNN code and installation files but if you have made it this far we'll assume you are properly equipped.

1.Downloading the Microsoft Web Platform Installer :

The Microsoft Web Platform Installer is a free tool for downloading applications from the Internet including the DotNetNuke installation, Internet Information Services (IIS), SQL Server Express, .NET Framework, and Visual Web Developer. To make installing DNN as simple as possible, it is best to install Web PI first. 

1. Open your favorite web browser and go to the site http://www.dotnetnuke.com/tabid/125/default.aspx/
2. Click on the Download It. Now button on the right side of the page.
3. Web PI will now start to download. When the Run/Save dialog appears, click on Run.
4. If prompted by the Security Warning, click on Run.
5. If you are prompted by the browser, click on the security bar at the top of the browser and allow the file to download.
6. Lastly, if you are prompted to allow access to run the program, click on Allow. 

7. Web PI will now launch and show the products available for download.
8. From this dialog you can choose the software to download. Click on Exit when you are done downloading  products. 

2. Installing SQLServer Express :

DNN currently supports SQL Server 2005 and 2008, but SQL Server Express is also a good solution for a website developer looking to run DNN from a single machine. 

1. Create new or use an existing database: Create New database
2. Database Administrator: sa

3. Database Administrator Password: use the password you choose when the database was installed
4 .Database User Name: Choose a user name (such as DNN5User)
5. Database Password: Choose a password (such as DNN5User2010)
6. Database Server: .\SQLExpress
7. Database Name: DotNetNuke



3. Downloading and installing the DotNetNuke package:
1. Start by launching the Microsoft Web Platform Installer.
2. When the list of available products is displayed, click on the Web Applications tab.

4. Click on the Install button to begin the installation.
5. The next dialog will list the file you are downloading and prompt I Decline or I Accept.
Click on I Accept.

6. Now DotNetNuke will download. Install by double-clicking on it. It will take several minutes, even with a fast connection. Halfway through the installation it may prompt if you want to reboot, click on No so that the installation will continue.


Now, comes the main part ,i.e; Running the DotNetNuke installation.
At this point you must have successfully completed the following recipes:
1. Downloading the Microsoft Web Platform Installer
2. Installing SQLServer Express
3. Downloading and installing DotNetNuke package


Follow the below steps for the DotNetNuke installation.
 1. Open your favorite web browser and go to the new site (for example,
http://localhost/DotNetNuke).

2. There will be a pause while the installation begins, then you will see the installation
wizard screen. 


 3. Select Typical for the installation method.
4. Choose English for the language.
5. Click on Next.
6. The next page will test the file permissions. The wizard will automatically check the file permission. You should see the message: Your site passed the permissions check. Click on Next.

3. Select Typical for the installation method.
4. Choose English for the language.
5. Click on Next.
6. The next page will test the file permissions. The wizard will automatically check the file permission. You should see the message: Your site passed the permissions check. Click on Next.



 8. For Server, go with the default .\SQLExpress.
9. For the Database, type the name of the database created when SQLServer Express was installed: DotNetNuke.
10. Leave Integrated Security unchecked.
11. User ID should be the user name you selected (such as DNN5User).
12. Password should be the password you selected (such as DNN5User2010).
13. Check Run as db Owner.
14. Type dnn for the Object Qualifier. This is optional, but it helps to separate out database objects that belong to DNN from those that don't.

15. Click on Next. You will now see status messages as the database tables and stored procedures are created. At the end should be the message Installation of Database Complete. If the installation was successful, pat yourself on the back and click on Next.
16. Now the wizard will create two users to start with: the SuperUser who controls the entire DNN installation and the Administrator user who administers the portals and has more limited privileges. 



17. For the First Name, keep the default SuperUser.
18. For the Last Name, type Account.
19. Select a User Name (avoid the standard host for the username. It is too well known).
20. Choose a good password and confirm it. Then write it down as you will need it later.
21. Provide your Email Address to get system messages.

22. Click on Next and provide the details for the Administrator user.


 23. For the First Name, keep the default Administrator.
24. For the Last Name, type Account.
25. Select a User Name (avoid the standard admin for the username. It is too well known).
26. Choose a good password and confirm it. Then write it down as you will need it later.
27. Provide your Email Address to get system messages.
28. Lastly, the wizard will prompt for the basic information for your site. Choose a title for your site and type it into Portal Title.
29. Select Default Website for the Template.
30. Click on Next.
31. When you see the Congratulations screen, click on Finished (Goto Site) to complete the installation.
32. After a pause you should see the Welcome screen to your new website.
Congratulations! You have successfully installed and set up a DNN website.


So, now you are ready to create your own websites.
You can post comments & queries if any. 

What is Windows Presentation Foundation

The Windows Presentation Foundation is Microsoft’s next generation UI framework to create applications with a rich user experience. It is ...