Wednesday, December 15, 2004

How Halo2 Works: XBox Live and the Network Model

I just read a really interesting article about how the Halo 2 network model works. Man oh man. Those dudes are so impressive. Anyway, its over at How Stuff Works if you're interested.

http://stuffo.howstuffworks.com/halo-network.htm

Thursday, December 09, 2004

How the Web Works: HTML for the Blogger (Part 1)

Ok. All you bloggers out there, this one's for you. I'm going to assume that if you're reading this, you don't know HTML at all. The point of this article is to give you just enough to really put you in control of your blog posts. Since applications like blogger have come around, there are a lot of web publishers out there who are not geek people. Blogger makes it possible to have your own website without needing to be a geek. But geek or no, at the end of the day, that message you put up on your website ends up as HTML. Instead of being afraid of that, let's use it to our advantage.

Tags

Ok. We've talked a little bit about tags before. Let's talk about how to use them. We'll start with some easy ones. The idea behind HTML is to tell the browser how to draw your data. The simplest form of that is text formatting. If we want some part of our sentence to be bold, all we have to do is surround that part of the text with the bold tags: <b> and </b>.

Tags are always surrounded in <these>. Also, notice that the second tag is just the same with an added /. That basically means end. so:
This is some <b>bold text</b>.
means
This is some [Start bold text here]bold text[End bold text here].

Ok, so there's the bold tag. What other tags are there? There are a couple other really simple ones that you may be interested in.
  • <b>bold</b>
  • <i>italic</i>
  • <u>underline</u>

Attributes

Those ones are ok. But it does get just a bit more complicated than that if you want to do more. One more thing we have to talk about is attributes. An attribute is just a further description of a tag. For example:
This is <font >some red text</font>.

See the attribute? Yep, 'color="red"'. Makes sense, don't it. Let's look at a couple more uses here.
  • <A href="http://www.spam.com">Links</a>
  • <IMG src="http://photos2.flickr.com/1682253_d8bcd882c2_m.jpg">
  • <font >font colors</font>
Notice the image (IMG) tag does not have an end tag. There are some tags that don't have end tags simply because they aren't really modifying something else. All the other tags I've mentioned here, modify content, specifically text. An image is content, so there's not really much point in trying to wrap an image around something else. You can, however, wrap tags around other tags. Let's say, for instance you want to make an image a link.
<a href="http://www.spam.com"><img src="http://photos2.flickr.com/1682253_d8bcd882c2_m.jpg"></a>


If you want to test out your own html before publishing it to the world, you can. All you have to do is follow these steps:
  1. Using notepad or another plain text editor, create a new text file. Plunk your code right in there.
  2. Save that file as "test.htm" or "anythingelse.htm", for that matter.
  3. Drag and drop that file right into any open web browser window.
  4. You can keep making changes just by editing the file and saving it, then clicking refresh in the browser.
As always, questions and/or comments are requested and/or appreciated. Thanks.

Wednesday, December 01, 2004

How the Web Works: What the Crap is HTML

Ok, we've talked about the browser, and we've talked about the server. Let's now talk about the content. What exactly is HTML? Some people think that writing HTML is "programming". I guess you could call it that, but HTML really is not a programming language. HTML stands for Hypertext Markup Language. Well then, what is a markup language. Let's take a few minutes to define a few terms.



Plain Text
This is just plain ol', unformatted text. Plain text contains no formatting information whatsoever. Microsoft word documents are not plain text. Web pages are (usually) not plain text. Here's an example of plain text:

Tomorrow, I'm going to go to the store. I'm going to buy some candy, some eggs, and Halo 2.



Markup Language: A markup language is a document format that contains formatting information. You can use the same tools to create plain text and markup language document. While this document format does contain stuff other than just text, it is still a document format. Here is an example:

In your browser, you would see:
Tomorrow, I'm going to go to the store. I'm going to buy some candy, some eggs, and Halo 2.

Here is the actual document:
<font color="red">Tomorrow</font>, I'm going to go to the <a href="http://www.amazon.com/">store</a>. I'm going to guy some candy, some eggs, and <font size="+2"><b>Halo 2</b></font>.



So, there you have it. Notice the diffrerences between plain text and markup text. They both contain the same two sentences, but the markup one has some formatting information and one link. Let's talk a bit about that second version of that html text. All that extra crap you see in there is the "markup", as in mark up your document with formatting information. Your browser reads all that and figures out how to draw the document appropriately.

Tune in next time where I will explain you all you readers out there how to use this stuff on your own sites.

Monday, November 22, 2004

Google the Amazing

Pulled this article out of the archives. Seems relevant for this site.


I'll bet most people that use google have no idea how cool Google really is. How many other search tools have their own verb? You know, as in "I Googled myself today" or "Just Google 'weebles wobble'."

There is so much you can do with Google. An experience Googler can find anything in just a few minutes. How can one become a skilled master of the Google? Here's a few pointers to get you started discovering the power that exists behind that one simple text box.

To really use Google well, it helps to understand how the tool works. Searching is a fairly simple principle. A search engine first has to "spiders" the web. It will read one page and follow all the links on that page, then read those pages, then follow the links on those pages, and so on. Once it grabs the pages, it creates an index much like the index in a book only its designed to be read by a computer. When the user inputs his search criteria, the software looks through its massive index and tries to return the most relevant data.

This is an incredibly simplified version of what's actually going on. Google does all kinds of stuff to make sure everything is fast and highly relevant. They have lots of criteria for making those decisions and some of the smartest minds in tech world putting their tools together.

Some interesting things about google searching:
  • case dOes NoT MattEr
  • Google will not match partial words: a search for 'apple' will not find 'Snapple'
  • Google will perform query extensions: 'apple' will find 'apples' (this is not the same as partial word matching)
  • by default, Google will ignore extremely common words like 'where' and 'how'
  • Google will try to help you by offering corrections to common misspellings: look for "Did you mean ..." at the top of your search results
  • Searches are 'and' searches by default: you can search within results simply by adding more search terms
Remember that Google's database is built off of the web. It created by software, not people. When you do a search, try to be as specific as possible. The less common the word is, the more specific your results will be. 'Pine tree' will give better results than 'tree'. 'Douglas Fir' would be even more specific.

All this is great, but we haven't gotten to the real special stuff yet. Lets look at some of the special features.

Dictionary:
When you look something up, on the right side, near the top, you'll see your search term as a link. It's actually each word linked individually. If you click on a word, it will take you to the dictionary.com page for that word. Another way to use Google as a dictionary is to ask it for a definition. Use 'define: term' to request a definition. In my experience, I find that dictionary.com is better for general words, while Google's 'define:' search is better for less common, more industry specific. Google doesn't just search standard dictionaries. It also looks through specific dictionaries, like medical terminology, tech term definition sites, etc.

Tracking:
Drop a FedEx or UPS tracking number into that beautiful search bar and it will take you right to the tracking info for that package. Pretty handy.

Translate:
If you run into some site in German, Japanese, or any one many languages, Google can translate if for you. Look for the "Translate this page" link in search results or use 'translate: URL' in your search string.

Formatting:
Google is so magical, it can even index PDF documents. What's even better, it can translate PDF pages into HTML docs if you don't want to wait the nine minutes it takes for Acrobat to load up into your browser (or whatever). You can even search for files of a specific type by using 'filetype:type'.

Calculator:
This is one of my favorites. You can use an amazing variety of queries to perform calculations. Try googling 'how many feet are in a mile', '100 miles at 65 miles per hour in minutes', '4 cups in tablespoons', '4 times 10' or even figure out the benefits of carrying your friends around using '200 pounds times one mile in calories'. The point is, Google is amazing as a calculator or converter.

Etc:

There is so much more. It would take the rest of my life just to describe to you all the things you can do. Instead, I'm just going to point you in the right direction. Look at:

Wednesday, November 17, 2004

How the Web Works: URLs and the Grocer

Let's continue with our cake building metaphor, and look at it from another perspective. If your mother is the web browser, laboriously and meticulously building a beautiful cake for your pleasure, the grocer is the web server, serving mothers everywhere with the cake mixes they need to fill your belly.

The web server's job is simple. It's a computer somewhere out there in internet land and it holds the files you want. For every file on the web, there is a Universal Resource Locater (URL), which does what you'd think. It describes exactly where that file is. Let's say, for instance, you are looking for the document that this one follows up. The URL for that file is:
http://geekblogthatnoonereads.blogspot.com/2004/11
/how-web-works-http-and-your-mother.html (url is broken onto two lines, so it will fit on the page.

The server here goes by the domain name: geekblogthatnoonereads.blogspot.com. What exactly does this mean? Well, there are three parts, separated by the period. From the right:

".com" is the domain suffix. Its was put there by the internet gods to help categorize domains. There is 'com' for commercial, 'net' for network, 'edu' for education, 'gov' for government, 'org' for organization, and others. .Com and .Net are kind of over used, in my opinion. Lots of people just choose .com when setting up their server because they are used to it. It is, in reality, not better or worse than .net, .info, .tv, or otherwise. In fact, sometimes, it's the wrong decision. If you are a non-profit organization, you should not choose a '.com' domain. You should choose '.org', to specify that your are an organization, not a commercial entity.

Anyway, the next part (from the right) is the domain. These domains can be purchased from registrars and can be owned by individuals or corporations, etc. The point is, they are owned and controlled by someone. So, when you go looking for 'google.com', the Domain Name Servers (DNS) act as the phone book for the internet and tell your computer exactly where to find google.com.

Finally, there is the subdomain, in our case, its 'geekblogthatnoonereads' but it could be anything like 'www', 'mail', or even left off entirely. The subdomain is exactly that. The main DNS servers will get you as far as 'blogspot.com', but it's up to the people at blogspot to get you where you really want to go.

So, to review. I own 'tunasoft.com'. If you go looking for it, one of the 12 world authorities will tell you where my server is. But if you want to get to 'www.tunasoft.com', you'll have to go to my server and ask for directions. It could be on that same server, or it could be on any other server in the world.


Ok, so we've reached the server. Let's talk about the rest of that URL: "/2004/11/how-web-works-http-and-your-mother.html". This is basically a description of a folder tree like on your own hard drive. To use our metaphor: isle 2004, shelf 11, and the box is labeled how-web-works...yadda yadda.

So that's pretty much it. You plunk that URL into that bar a the top of your browser. Your browser finds the server and asks for the file. The server grabs the file and sends it down to the browser.

It can get a bit more complicated. Some grocers will remember you. Some stores require a membership card to enter. But we can save those details for another article.


As always, questions and/or comments are requested and/or appreciated.

Wednesday, November 10, 2004

How the Web Works: HTTP and the Your Mother

I'm going to try my had at a metaphor here and say that a web page is like a cake. Let's say for instance, you ask your mother to make you a chocolate cake. Lets compare this to asking your browser to get you a webpage. Your mother is going to open the phone book and find the grocery store. Your browser is going to request, from the authorities, where the web server is. Your mother is going to go to the store and ask the grocer for the chocolate cake mix. Your browser is going to connect to the server and request the page that you asked for.

Now, an HTML page is very similar to a cake mix. It contains a large amount content, references to what other content you need, and instructions on how to put it all together. So, the browser is going to look at the HTML file and see what else it needs. This could be images, flash movies, other sets of instructions, or even other HTML pages. Your mother will look at the required ingredients and ask the grocer for them. So now that your mother has the mix, the oil, and the eggs, she can go home and cook you a cake. The browser has now gotten the images and styling instructions from the web server, so it will start to draw your web page.

Just like the box of cake mix, an HTML document contains instructions for drawing that page. Your browser will read that document, and put all the pieces together. It will pour in the images when necessary and it will follow instructions to make text bold and draw the background in the proper color. In the end, your mother has a beautiful cake to give you, and your browser has served up a steaming hot web page, fresh for your enjoyment.

This is, obviously, an oversimplified example. For instance, my mother already knows where the store is. Well guess what: your web browser remembers where sites you frequent are, so it doesn't have to ask for directions every time you request itchybutt.com. My mother usually already has eggs in the fridge. A web browser has a place where it remembers graphics and other files from sites you frequent. That's why logos and other common graphics tend to show up first on slow connections. They're already on your computer.

Sometimes, the grocer that has the cake doesn't have all the ingredients necessary to bake that cake. The browser is much less bothered by needing to look elsewhere for an ingredient. It just goes back to the authoritative server and asks for directions to the other server. And finally, some bakers, such as those in high altitudes have special baking needs and require special instructions. HTML even has that covered. It allows for special instructions for people who are blind, or need large print, or otherwise. There are even special browsers out there that can read a web page to a blind user.

So think about all that goes into one simple web page. Your browser works hard for you. Maybe you should show your appreciation by making it a cake. And since your browser can't really enjoy a cake. Just send it to me.



Questions and/or Comments are welcome and/or appreciated.

How the Web Works: An Introduction

A bunch of my friends have just started blogging and playing with misc other web goodies. I thought I would throw them all a bone and put up a series about how the web works. I'm gonna try to cover HTTP, HTML, CSS, and maybe even RSS as well as I can. Please post questions or corrections. I would like to make these articles as effective as possible.

XSLT and RSS

Statement: Every RSS feed in the world should have an XSLT stylesheet.

I was listening to a discussion from Gnomedex that iPodder grabbed for me. This guy from Yahoo was talking about their new RSS tools. One of the things he mentioned is the new button. He made a good point. A lot of people see that little, orange "RSS" button and give it a click. They're then faced with a naked XML document. That can be very confusing for the average user.

While the Yahoo link is a good option, it really is limited to only Yahoo's users. XML documents have the option of linking in other docuemnts for formatting their data. One format that's particularly insteresting is XSLT, which is a formatting markup language for XML. Most modern browsers can parse this data, and will do so automatically.

What this means for the user is this: Instead of seeing some confusing looking XML document, users who navigate to an RSS feed with their browsers can actually see a very usable web page. At the bare minimum, it should be a doc that explains to them what an RSS document is and how to use it. Even better, it could be a formatted version of the content of the XML document. Idealy, it would do both. Using XSLT, an RSS doc can become just like any other page a user might view. They can even bookmark it and just go there instead of downloading some RSS aggregator.

The really cool part is that all this is done without messing with the actual XML doc. Thus, all RSS aggregators can grab the exact same document and do their magic with it.

I really can't think of any reason why someone would not want this on their site. If you can think of any, I would love to hear them.