Sunday, December 20, 2009

Google's Newyears Countdown!

Googles New Years countdown begins! (Dec 21, 2009)

8 Days

At the bottom of the image, below the sailboats, and beside the tree, two islands which make up the '8' in the countdown! Happy hunting google lovers!

XHTML/MIME, For once and for all.

The Internet has undergone many transformations over the past decade, and with w3c's Web Standards Specifications, an initiative to modularize markup and expand accessability and forward-compatibility, for browsers, and languages to come. (Note: Legacy browsers [Eg. Internet Explorer 7 and below] will eventually be depreciated, to make new browsers more compliant with these standards)


Along with these new specifications, comes the confusion of multiple !DOCTYPE'S and MIME types. When creating an XHTML valid page, you must use XML-valid definitions, including defining a !DOCTYPE, and the corresponding MIME type must be used. If this is not the case, the document will not be considered "well formed", and will thus be treated as HTML, or tag soup NOTE: This does not mean it is tag soup. What is tag soup?


Sending XHTML 1.1 as text/html is NEVER fine. There is no spec that allows this. Sending XHTML 2.0 as anything in a production (non-testing) context is NEVER fine either, since that spec has not reached CR yet.

Sending XHTML 1.1 as text/html is considered to be "non-standards compliant", by all standards. Using XHTML 2.0 in a non-testing environment is forbidden, as it has not yet reached a controlled release or conformed release, where all browsers are released as standards-compliant. The solution is to send application/xhtml+xml to the MIME Content-type, using .htaccess.

Serving up a document containing what is to all intents and purposes XHTML as text/html simply means that browsers will jump into error correcting mode and deal. Serving the same document as application/xhtml+xml will, in most cases, present the user with a download dialogue of some sort.

However, this solution does cause problems in Internet Explorer, all versions, up to and including 8. When pages with the MIME Content-type set to application/xhtml+xml are viewed by IE, rather than showing a website, the user will be prompted to download this "application". They may be neck and neck for web standards, but they're still doing a lousy job, for such a large and powerful company.

The most-used attribute on html elements is xmlns, from misguided people using XHTML but sending it as text/html. They even (just) outnumber the people who specify the lang attribute!

This quote from Google's own Web Stats site gives us a visual approach to showing the MOST common approaches of web design, including (Correct and incorrect usages explained):

  • How many elements do Web pages typically have?
  • Most used tages/elements
  • Most common attributes used
  • META data
  • Much more

Googles web stats resource shows how/why the w3c-standards were developed, through rigerous analysis of content usage, and web browsing evolution. X/HTML5 is being developed with these figures in mind.


Conclusion

HTML5 doctype is simple, and backwards compatible with previous versions. It can produce valid code, and can be used to-date. XHTML has a few "quirks" which need to be worked out, but are not major problems for the average joe. The biggest tip I can give to any junior web developer is:

  • Do your research, for YOUR specific needs
  • Take note of versions, dates, time periods of documents to insure validity
  • When in doubt, use a controlled release, or stable release (ie HTML 4.01)

Other resources/citations

Wednesday, December 9, 2009

Joomla, CMS for beginners!

Being the master of your own domain is always a plus, especially when speaking in a litteral sense. In web design, it is always good to be versatile. This means being able to design in new ways, try new system setups, experiment with different content management, and plugins, for those who like things done for them.

Today, we'll be dealing with Joomla, one of the strongest and fastest growing free Content Management Systems available in this part of our galaxy. Joomla's "theory" can be daunting enough for the average user, so to make it much less painful, I've devised a simplified explanation of Joomla, as well as a few snapshots, to show how it works.

What is Joomla?
Joomla is generally a group of webpages (to help you 'install' it [configure for your system]), scripts (to manage the content on your page) and databases (to store information for your page). Your first step, is to download the latest copy of Joomla, and extract it to a folder called Joomla.

How can it be used?
If you do not have webspace (ie, godaddy, www.yoursite.com), you can actually setup your home computer as a server. THIS IS EASIER THEN IT SOUNDS. Google xampp, it has all the programs you'll need, preconfigured! Download this, install it, and navigate to [XAMPP/htdocs.] folder, here you may drag the folder you created earlier, called 'Joomla'. XAMPP will act as a host for your website, like a virtual .com, except instead of a domain name, you are using your assigned ip address. Note: Other users can still access it using your external IP! Click here to find out your IP!.




Setting it all up
This tutorial is about Joomla, check back for a XAMPP tutorial soon. Once you have the folders in the correct places (Refer to picture). To configure Joomla, (which they call 'Install'), open up a browser window, and type http://localhost/Joomla/. This will automatically start your configuration! (Note: if yours is in webalizer, you must insert use path 'http://localhost/webalizer/' to access your joomla installation)




After install

After install, the onscreen instructions will tell you to delete the installation folder. THIS IS NOT THE JOOMLA FOLDER! There is a folder inside Joomla, called Installation, delete that folder. This will stop Joomla from opening the install everytime that directory is navigated to. Instead, the page which was chosen during installation will. (Sample webpage, or chosen template)


Working with system files in OSX

Have you ever been doing any sort of file interaction - opening, editing - and all of a sudden, you get a nasty STOP error. "Unable to access file, permissions unavailable" - this is your computer telling you, this may harm your system if you access it! The solution? Prove to the computer your not stupid. You want to tell it to give you "root-access" to the file system. If your a mac lover like myself, you'll be glad to hear that theres a solution to errors such as "Must have root access to modify file" *Click* 

The hometown hero in this case, is sudo. A four letter word is the solution to those awe struck moments, staring at an error with no suggested solution. The word sudo is written inline with the command, for example:

sudo /path/ProgramToEditWith/ (note: there is a space b/w the two paths) /filepath/filename.ext

Take note, there are many other things that can be done with sudo, as I like to say, google it!



Useful commands:

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /filepath/filename.ext
The command 'sudo' will allow a user to act as a superuser/root, upon submission of password. The user will use TextEdit to edit selected file path, with root privileges. Note: There is a space between the two paths

sudo cp /path/file.ext /newpath/filename.ext
In this case, the user is also given root privileges, but not to open a file, but copy it. This may overwrite the file, or create a new one, in the same directory or a new one.