HTML Tutorial – Lesson 2: Structure and Method

February 14th, 2010

I’ll bet you’re thinking “Structure and Method? What is this… some kinda textbook???” Well, no, in this lesson you’ll be learning about the Structure of HTML and the Method that is used to make them.

HTML does not need to be coded with some special “HTML tool”, and you don’t even need some special program like Microsoft FrontPage or Macromedia Dreamweaver (In fact, I discourage their use until you know the ins and outs of HTML code). All that you DO need is a simple text editing program like windows built in Notepad. You’re probably thinking “Wait just one second, you’re telling me I can code up another Yahoo! with my puny little Notepad? Yes! That’s part of the beauty of HTML! In fact, this entire tutorial was created in TextPad, a simple and very cheap text editor.

When you make a Web page the first thing you need to do is gather your content. For our first page ever, we’ll be making an informative page about ourselves. For example here is mine:

Welcome to Justin’s Web Page!

Hi, My name is Justin. I built this web page because I love writing HTML code! I could do it all day long (and sometimes, i do). I am a lover of programming languages, and love to design and produce web content. Thanks for visiting my page!

Yours Truly,
-Justin

Go ahead and think up a few paragraph’s like this, and meet me at the next lesson.

HTML Tutorial Lesson 1: Introduction to HTML

February 8th, 2010

Welcome to my HTML tutorial!

Soon you shall be on your way to building great Web Pages and vast Web Sites, but first lets go over a thing or two about what a “Web Page” is, how they work, and what we can do with them.

For this tutorial you will need:

  • An Internet ready computer
  • A web browser

Because you are reading this on my blog, I will assume that you have both of these things.

Let’s jump right in to the lesson!

In the beginnings of the Internet, it was very hard to exchange data. So with great vision and foresight, Tim Berners-Lee created a way to connect text on the Internet through Hypertext Links (References to other text on the Internet). This wasn’t a new idea, but his Hypertext Markup Language (HTML) was very popular and caught on better than other competing projects.

HTML is not a “Programming Language” per se, but rather a scripting language that marks up the page with formatting commands. Your Web Browser then reads these commands and shows the formatted page on your screen. Because the popularity of the Web programmers began writing Web Browsers that could display graphics and a wide range of other content. Thousands of people started to create web pages ranging from personal “homepages” to business information pages and rich internet applications.

Today billions of people access the web, and a there is a huge diversity of sites that have sprung up for their each of their needs. Before going on to the next lesson, I suggest that you go out and view many pages that are out there on the Web. As you are viewing them, to view the HTML behind the page click View->Source if you’re using Microsoft Internet Explorer, or View->Page Source with Firefox.

Lesson 2

Data Binding using ASP.NET

February 2nd, 2010

Data Binding creates a link between a particular control to a specific column of a table in the database or to an entire table in the database. With ASP.NET data binding you can also bind any server control to the output of different methods and expressions.

On ASP.NET pages when we are doing databinding it is necessary to use the basic syntax for all expressions.

For example:

<%# EmpID %>  This syntax is for a simple property.

<asp:ListBox datasource=’<%# firstArray %>’ runat=”server”>  This syntax is for a collection.

<%# (emp.First Name + ” ” + emp.LastName ) %>  This syntax is for an expression.

<%# GetSalary(EmpID) %>  This syntax is for the result of method GetSalary().

If you are using a list control the following syntax is used:

<asp:Label runat=”server”

Text=’<%# Container.DataItem(“EmployeeName”) %>’

If you are using a RadioButtonList control to bind data then the syntax is:

<html>

<body><form runat=”server”>

<asp:RadioButtonList runat=”server” />

</form></body>

</html>

In multiple data bound Values in a Hyperlink Control with a GridView:

<form runat=”server”>

<asp:SqlDataSource runat=”server”

ConnectionString=”server=localhost;database=Northwind;uid=x;pwd=y”

SelectCommand=”SELECT ProductID, ProductName, QuantityPerUnit,

UnitPrice, UnitsInStock, Discontinued FROM Products” />

<asp:GridView DataSourceID=”datasource1″ runat=”server” />

</form>

If one wants to navigate between the fields then the syntax is:

DataNavigateUrlFields=”ProductID,SupplierID,ProductType”

In the following example, the code below uses a feature to provide a hyperlink that contains two values, both extracted from the current row of the employees table, for the href attribute:

<asp:SqlDataSource runat=”server”

SelectCommand=”SELECT EmpID, CompanyName, City FROM employees”/>

<asp:GridView DataSourceID=”datasource1″ runat=”server”

AutoGenerateColumns=”False”>

<Columns>

<asp:BoundField DataField=”EmpID” HeaderText=”BoundField” />

<asp:HyperLinkField runat=”server”

DataTextField=”employeeName”

DataNavigateUrlFields=”EmpID,City”

DataNavigateUrlFormatString=

“http://yoursite.com/showemployee.aspx?id={0}&city={1}” />

</Columns>

</asp:GridView>

The resulting value for the href attribute will be something like this:

“http://yoursite.com/showemployee.aspx?id=00123&city=Mumbai”

In the above example city of the employee is “Mumbai” and employee id is “00123”.

Databinding simplifies applications; and with less code a fast execution is done. .Net helps the programmer by reducing his/her work and time spent coding a data abstraction layer.

A review of Adobe Flex Builder

January 30th, 2010

Adobe’s FlexBuilder is the Software Development Environment for Flex, Adobes Rich Internet Application platform. FlexBuilder is built on Eclipse, so any computer you run on it should have > 1 GB of ram and a processor > 2 ghz.

FlexBuilder is a very satisfying environment to work in. It is much more natural (as a programmer) to use than the actionscript editors in Adobe Flash. Because you are working in a fairly heavyweight Eclipse environment, those used to working in Microsoft Visual Studio may find FlexBuilder a bit slow. FlexBuilder does have a set of very capable debugging tools however, and these tools alone make the near-$250 price tag worth it. The addition of the powerful Designer mode (much like the Design view in Visual Studio) also adds a lot of value. Because of these features I strongly recommend Adobe FlexBuilder for development, and consider it a worthwhile addition to any Rich Internet Application programmers toolkit.

Rating: 8 out of 10
Pros: Feature packed, Eclipse environment is very configurable, Natural environment for experienced programmers.
Cons: Eclipse is a resource hog, so check to make sure your computer meets the minimum specs before buying.

Google Analytics is made of win

January 29th, 2010

This week, for the first time, I got on the Google Analytics bandwagon. I never thought charts and graphs could be so damn fun. Look at this:

Google Analytics site overlay

Google Analytics site overlay function

That is what Google calls the “Site Overlay” (it’s under the Content menu, if you’re looking for it, Googlers/Bingers). I was FLOORED when I saw it for the first time. The numbered percents everywhat represent the percentage of visitors that clicked the link – but I’m sure you didn’t need to be told that, since the data is clear as day.  WAY TO GO GOOGLE for taking data visualization to the next level.  Mad props.

A Detailed Introduction to SOAP

January 28th, 2010

SOAP stands for Simple Object Access Protocol and is used for communication between applications through the Internet. SOAP is a platform and language independent. It also allows applications to communicate between each other though both applications are on different operating systems. SOAP messages are typically written using XML.

Here is an example of SOAP syntax:
Read the rest of this entry »

A comparison between MFC and Win32 in C

January 25th, 2010

First let us start with the “Windows SDK” (Software Development Kit) which is designed to create Windows applications. It consists of large set of functions, messages, structures, macros and resources. It is a set of tools designed to help C programmers create Windows applications.

Windows SDK consists of the large set of books describing functions, messages, structures, macros and resources. There are also tools including a dialog editor and an image editor, on-line help files and a set of windows libraries and header files.

It has large collection of API (Application Programming Interface) functions written in C. The API is a set of functions that are part of Windows Operating System. Programs can be created by calling the functions present in the API. One doesn’t have to bother about the internal working of the functions – just knowing the function prototype (name, arguments) and return value one can invoke the API functions. A good understanding of the Windows API will help you to become a good Windows programmer . Windows itself uses the API to perform its GUI magic.

Read the rest of this entry »

Threads in Java

January 18th, 2010

Java supports multithreaded programming. Threads means part of the program which runs concurrently and which defines separate part of execution. Threads are present in many states.It can be running or it can be made ready to run as soon as it gets CPU time. A running thread can be suspended temporarily and also can be resumed. Thread can also be blocked, it can also be terminated in which execution is stopped. When thread is terminated it cannot be resumed.

Read the rest of this entry »

Data Types in C#

January 10th, 2010

C# is a language in which every variable and object should have a declared type.In this article we are going to discuss about datatypes in C#. Many dataypes in C# are from C and C++.

There are different ways of defining data types in C# let us see each of them in brief:-
Read the rest of this entry »

Newly upgraded WordPress

January 9th, 2010

Have an old WordPress install? I was recently amazed at how easy it is to upgrade to the latest and greatest. The WordPress Codex has an article on how to do it here.