Chris Worfolk's Blog


Introduction to HTML

September 16th, 2007 | Programming, Tech

HTML is the standard for creating web pages over HTTP. HTML stands for hyper text markup language. HTML is controlled by the W3C which is an assosiation assigned to setting world standards on the internet.

HTML has had different versions throughout its life. Until a few years ago (about 2000) HTML 4.01 was the standard, but since then the W3C has made XHTML 1.0 the official standard lanuage although software has been slow on the uptake. Internet Explorer 6.0 supports XHTML, and a few of the latest web editors such as Dreamweaver MX also support it.

What is HTML made of?

HTML is made up of tags such as <head> or <table> of which content is then put inside. <p> stands for paragh and every time a new <p> tag is used another paragragh is added to the page. Take a look at this code:

<p>This text would be in its own paragragh</p>

After the content is in the tag is closed with a slash inside the tag. In this case it is </p>. Most tags need closing. However some tags such as Horizontal Lines <hr /> do not. A HTML page is made up of two main sections. The head and the body. You will learn more about these later.

Response.Write in ASP

September 16th, 2007 | Programming, Tech

Changes are if you are using ASP you will sometime want to write in something into a page without going back into HTML. You can always open an IF then close the ASP script write in your HTML then open the ASP script up again and END IF. However this is not always practical.

When it’s needed

Some WYSIWYG editors will display little ASP icons where ASP scripts are and if you are using one page to house several pages of content then you will want it all to be inside the ASP script so that it doesn’t mess up and stretch the layout of your page.

However if you are opening and closing ASP scripts with HTML in between, all the HTML will display in between all these scripts and will be fully visible on your page rather than being contained in the little ASP script icon.

Another instance would be when you want your HTML content to be in a variable. Say if you wanted to use the same block of HTML script in two places or repeatedly say for a newsletter script then it would be easy if all the HTML was in a variable you could just include anywhere in your ASP script.

Being ASP ready

Most HTML tags will go in the basic format for Response Write in ASP fine as there are no limitations as its al contained within markers to show what is ASP script and what is the content you are setting as a variable. For example:

Response.Write("all the code goes here and its all contained in this area nicely")

The problem is that often in HTML, the quote mark is used. But using one of these ” in a response write ASP command will close the Response Write area and code will be left out and start causing all sorts of errors. For example:

Response.Write("<img src="somepath_is_outside_the_quotes"")

Quoting the problem

How do you contain these problems then? By removing or even adding quotes. The first option is to simply remove all the quotes or as many as you can. This means that it isn’t formatted correctly and W3C won’t be happy with you but they never are anyway ;). It will still work in the user’s browser at any rate.

<img src=somefile.gif width=100 height=200 border=0 />

This code appears fine, and it would display fine. This can then be put between the quotes in a Response Write tag in ASP. Problems do not end there though – what happens if your need spaces in a variable. There you couldn’t use the above tactic.

Spaces and doubles

Take a look at the following code. There may be better examples but this one works fine. Its an image with an ALT tag with some keywords in it.

<img src=somefile.gif border=0 alt="some keywords go here" />

There is a problem. The ALT tag has spaces in, so after some, the browser may think that everything beyond there is something else. And with good reason as we could replace keywords go here with width=50 and we wouldn’t want that to be part of the ALT tag.

The solution it to use double quotes.

<img src=somefile.gif border=0 alt=""some keywords go here"" />

This keeps the ASP code correct and adds a quote into the HTML when it is sent to the browser. It’s a bit longer and more code that usual but you can easily change all the ” to “” with a quick find and replace.

Using Request in ASP

September 16th, 2007 | Programming, Tech

The request function, suprising requests a value. This could be a query string, form variable, or some other value. For example if you were at the following URL.

http://www.somepage.com/home.asp?ID=23

And you had a script as such.

Request.QueryString("ID")

The call would return the value 23.

An example of where this can be used is on the M World News channel. The news is stored dynamically in a databasde so when you click on a link to the full story from the news homepage you are taken to a dynamic page which selects the story based on the ID of the story you want passed to the page as a url variable. For example the link could be:

http://www.mworld.us/news/story.asp?ID=52

Examples of use:

Request.QueryString("SomeURLVariable")
Request.Form("SomeFormElement")
Request.Cookies("SomeCookie")

Hello World in ASP

September 15th, 2007 | Programming, Tech

This is how to do a basic Hello, World! in ASP.

<html>
<head>
<title>Hello World in ASP</title>
</head>
<body>

<%
Response.Write("Hello, World!")
%>

</body>
</html>

There are two parts. The first is the Response, this tells the server that it needs to do something – to send something out as it were. The second part, in this case Write, is what it has to do.

ASP basics

September 15th, 2007 | Programming, Tech

ASP code is added like scripts to HTML. You open an ASP script using the tag.

<%

You close it using the reverse.

%>

Therefore in a HTML page it would look like the following.

<html>
<head>
<title>Example script</title>
</head>
<body>

<%
' here is some ASP script
%>

</body>
</head>

Notice the use of a comment in the script.

<%
' This is an ASP comment
' Here is another
%>

The faces we let others see

September 14th, 2007 | Life

I headed to uni today for the international fresher’s fair. I met loads of people I haven’t seen for ages, people off my course, A-Soc people, union people. I got there and met more people. Every conversation was the same. “Hows it going?” “Not bad.”

I fully understand it’s like an automatic response to just say you’re fine. But you would think you eventually reach some distance from fine where you stop just telling people that you’re “not too bad.” Apparently not. Still, when you have a society to run and it’s literally days before the new term starts, braver faces are in order.

Let’s catch up

September 10th, 2007 | Life

Quite a few of us have blogs now. It’s great to see people blogging, uni involes far too much face to face contact for my liking. I don’t want to have to leave my room to find out what you did today. Blogs are the solution. I feel we’re slightly under utilising them though. We could be pinging each other like crazy.

For instance, I could make a quick comment on the fact that George has auctioned himself off as a human pet when only two months ago when I offered to purchase him in a deal for his liver, he declined my offer.

So in the spirit of cross-circle blog linkage, tell me what you are up to in the final week or so before the start of the new academic year. How do you feel about coming back to uni, what are you planning to do this year, etc, etc.

Personally, I don’t really know where I’m at. I didn’t really think about it for most of summer, then I didn’t really want the new term to arrive. Then I started to. Now I don’t really know how I feel. I can’t say I’m looking forward to the work and the general hecticness that uni brings. With work I can generally go home and stop worrying about it (to an extent at least) whereas at uni it’s never really off your mind as you always have something to think about.

I still haven’t really set a plan in stone as what I’m doing yet. I’m going to start moving my gear in any day now but I can’t really be bothered to be honest. It’s just more upheaval and stress and to be honest, I have other things on my mind. Indeed, other things on my mind than university as a whole.

Sour grapes

September 7th, 2007 | Thoughts

So, yesterday was the CompSoc EGM. It got quite an impressive turnout of 18 people which is quite an improvement on the AGM which all of 2-3 people bothered to turn up for. The (now) interim committee has made way for Sam as president, Norm as secretary, Martin as treasurer and Kieran as vice president.

So yeah, I lost out on president. Generally due to lack of support, the (to be as of two weeks) level 3 students consisted of myself, Kieran and Maths Chris. Though obviously not being in the room when the votes were cast I don’t actually know what went on. Maybe nobody at all voted for me.

It’s funny, when I was first offered the job as president, I look it relucantly as I had other commitments and was never really a big fan of CompSoc. But once I got into it I threw myself into the role and found myself with a new vibrant attitude towards the society. For the first time I really wanted to be involved in CompSoc, to give it a good future.

I thought I did to be honest. In the month or so we had the interim commitee we got events planned, we got issues sorted, we actually had a committee that wanted to run CompSoc. We had people excited about taking committee jobs. That’s the first time I’d ever seen that happen – the first AGM I witnessed saw people taking positions just because nobody else would do it. Ash wanted to be president everyone else just said “yeah, ok I’ll do it.” The second AGM, well, nobody turned up to it. Then, over summer, we actually had people wanting the jobs for the first time.

Today’s EGM was another apathetic wash-out. Kieran was unchallenged for vice president, nobody at all actually wanted to run for secretary or treasurer really, it was another case of “yeah, I might as well fill a committee place to make up numbers.” Sadly, it’s the same old story for CompSoc.

Cornwells Drive

September 4th, 2007 | Thoughts

If I don’t write something I’ll probably end up sat here forever. So I’ll just keep it to this.

Season 2

September 1st, 2007 | Life

I’ve had a post entitled season 2 sitting in my drafts for a long time ago. Since last September I believe. The top paragraph of it it explains how this is a redraft because it’s been sat in there for so long. Well, I’m just rewriting it all from the start. With a whole new approach. I need I need a little more explanation.

After the success of my post, season finale which is one of three posts I am really proud of, I decided to continue the theme to look and see what themes we may see this year based on the second season of Dawson’s Creek.

The season is 60 seconds consists of Dawson and Joey getting together then soon breaking up again and ending with Joey’s dad returning from prison but Dawson finds out he is involved with drugs again and he ends up going back to jail with Joey blaiming Dawson. Abby dies, Andie enters the storyline and dates our renegade hero Pacey, Jack, the future gay guy and 5th main character comes in, Tamara briefly returns to remind us of the past.

I never got round to publishing the original post because I couldn’t really make the pieces fit. While Si really entered the storyline this year he turned out to be heterosexual, or at least, hasn’t come out in time. Our will they won’t they couple never officially got together. Nobody died. The symmetry just wasn’t falling into place.

Then a few weeks ago I had a thought. A spark of possibility appeared before me. Perhaps the season didn’t have to run from the start of term time to the end of term time. Perhaps it ran from the start of term to the start of next year’s term – in which case it isn’t over yet.

If you include the summer period then a hole host of possibilites open up. Our will they won’t they couple have been seperated albeit under different circumstances. Break ups, make ups, sex, lies, the drama has flown thick and fast over the summer. All we really need is a season finale. Some big event to leave us on edge for the start of the new academic year. And we have two weeks to get it.

So why am I writing all this now? Why after all this time of the post sitting in my drafts is it finally seeing daylight? Well, I think I may have found one. Maybe, just maybe.