Thursday, 14 June 2007

W3C Validator is not infallible

If you want your pages to be considered valid, you probably use W3C's mark-up validator. This thing is pretty smart - even though some of its messages don't make a lot of sense.

I used to think it was infallible, but I should have known better. Like CSS and JavaScript inconsistencies across browsers, the W3C validator is also not quite perfect.

I recently used to it validate some php pages. Obviously, the validator only validated the X/HTML that was rendered, but it failed to pick up the following slips.

I had to edit what was a textarea, to make it a simple text input box:

ORIGNAL CODE:

<td class="hr"><textarea name="street_address_1" rows="4" cols="35" maxlength="100"><?php echo str_replace('"', '"', trim($row["street_address_1"])) ?></textarea></td>


EDITED CODE:

<td class="hr"><input maxlength="100"
name="street_address_1"></textarea></td>


Even though I had failed to remove the </textarea> tag in my edited version, my page validated.

On top of this, I had a few instances of
<input type="checkbox" value="Yes" name="is_publisher">

The validator ignored the fact I hadn't closed the tag, and I'm pretty sure that's a basic requirement of XHTML 1.0 Strict Mark-up!?

Sunday, 10 June 2007

MySQL says "boo" to booleans

MySQL is supposed to be "all that". Simpler than SQL yet just as powerful (and hey, it's free, so I ain't complaining here)... however, I was pretty surprised to find that there's no data type called "boolean" in MySQL. If you want to do something as simple as store a 'yes' or 'no', you've got to use the enum data type and then create a string of values that will represent your options, eg.

For yes/no radioboxes on a form, you'll need to use
enum('1', '0')
as your data type, where 1 = 'yes' and 0 = 'no', but you could use whatever labels you wanted, eg. 999 = 'yes' and 666 = 'no'.


Mind you, enum is pretty cool, because unlike the narrowminded boolean, enum will allow you to extend your list of options, eg.

For a form with a drop-down box containing the following options:
- Yes
- No
- Occasionally
- Prefer not to answer

You could use
enum('1', '0', '2', '3')
as your data type.

In this example, 'Yes' = 1, 'No' = 0, 'Occasionally' = 2, and 'Prefer not to answer' = 3.

Thursday, 7 June 2007

Please explain indexing...

So the DMT class is over but I figure I'm gonna do a few more blog posts - I just might pass this subject if I blog on the things I thought were interesting 10-12 weeks ago... but as for this blog, it's about something I just learnt (this betrays the status of my 'System Build')... indexing in MySQL, what a neat function. Now I understand how clever uses of the index feature can speed up data retrieval in a database.

Thank you Ian Gilfillan for explaining this in "Optimizing MySQL: Queries and Indexes".

Basically, the index feature allows the quick look up of data. For example, rather than scouring an entire databases for someone's name, if you index the 'firstname' and 'lastname' columns of your 'contact' table, when you run a name query, these columns get queried first - so rather than looking through your entire database until your query gets lucky, it looks straight at where the data sits.

Ian also covers the EXPLAIN query in MySQL, which enables you to QA just how efficiently you have used the index feature. I know this is a bit late for a lot of my fellow students to take advantage of, but it's a handy tip nonetheless.

Monday, 14 May 2007

Entity Relationship Modelling

I started filling out Excel worksheets with column names for a DB I'm creating for my DMT class. Each worksheet represented a table in my DB. I realised that my brain would soon explode unless I had some way of plotting how the tables related to eachother. I searched the web and found two gems...

The first is a library of exisiting database schemas for common systems <http://www.databaseanswers.org/data_models>. These are handy blueprints to have and I recommend that my fellow DMTers browse through it (unfortunately, it didn't have anything that quite fit what I'm building). What I got out of it was being reminded of the notation that's used in Entity Relationship models (I was also reminded of the term "Entity Relationships"!).


originally proposed by Peter in 1976 [Chen76] as a way to unify the network and relational database views. Simply stated the ER model is a conceptual data model that views the real world as entities and relationships.

(http://www.utexas.edu/its/windows/database/datamodeling/dm/erintro.html viewed 14th May, 2007)


The part I love most about ER modelling is the notation used. Once you learn it, it makes you feel smart - and it's so easy. Any time-poor sod can learn it within a few minutes. "Crows feet" and "one-to-many" relationships etc. the following diagram sums it up really well. Can't wait to add it to my System Plan, I almost feel like a real IT geek.



Click here for full-size image.

Sunday, 6 May 2007

XHTML Not Fully Supported by IE?

While researching for my DMT "Micro and Macro Analysis", I came across a web page that surprised me. It seemed to say that XHTML is not fully supported by IE (should I be surprised?). The page can be found at <http://www.w3.org/2000/07/8378/xhtml/media-types/results>.

I included this 'IE' fact in my "Analysis" but it seemed like a bit of a lazy blanket statement so I revisited the above web page tonight - to try and make sense of what the test results actually mean. I am having trouble understanding what it does means and would love if someone could throw a layman's explanation my way.

Basically, what is the difference between the four scenarios being tested?:
1. text/html
2. application/xhtml+xml
3. text/xml
4. application/xml

And how do these different 'types'(?) exist in an XHTML document? What would the declarations for each look like? I looked at sample code for 1. and 2. and can't actually see any difference!?

Example for 1. <http://www.w3.org/2000/07/8378/xhtml/media-types/test.html>
Example for 2. <http://www.w3.org/2000/07/8378/xhtml/media-types/test.xhtml>

Tuesday, 24 April 2007

Surprising Blog - PHP uses less resources than ASP .NET!

I usually yawn at the thought of reading blogs, until I find myself drawn into one after a casual web search. When I find myself wanting to reply to the blogger, then I am really shocked. One such blog/ger caught my eye tonight... the URI is http://www.hwhappy.co.uk/2006/11/30/why-php-is-better-than-asp/#more-7 and yes, I even made a comment, the same I want to make here:

For years I worked with some developers who said ASP was absolutely the way
to go, and that PHP was rubbish because it sucked up system resources, so it's
very interesting to read that "PHP code is much faster, ASP is developed on the
COM based architecture, this is an overhead for the server."


It is interesting to note that it seems this blogger uses "ASP" to refer to ASP .NET, when officially, ASP does not use the .NET framework at all (because it's an older version of the technology, with a file extension of .asp rather than .aspx). I wonder if this abbreviated term will become the norm - as more systems move to .NET and no one remembers ASP ever existed without it?

Sunday, 22 April 2007

Final Learning Contract for Digital Media Technology

I have updated my Learning Contract - it is no longer going to be a system to update flash ads using XML but rather a database to contain publisher's rich media advertising specifications. I made this change because of the demand for a system such as this at work. I figured that I could sneak it in as part of this project and "kill two birds with one stone".

My updated Learning Contract has also moved home - from the UTS servers to a privately hosted space at:
http://dmt.webgeniedesign.com.au/Jeannette_Durick_Learning_Proposal_FINAL.htm

Wednesday, 21 March 2007

Confessions about blogging and some stuff about PHP (and bookstores)

Tim keeps reminding us to blog. I don't need reminding really - I remind myself all the time, I just never get around to doing it. I would like to think I can sit down and create a well thought out piece of genius... and that takes time, so I end up never blogging about anything - and here's the relevance to my MIM degree... I am a prefectionist and that makes me a procrastinator. Very relevant to the (un)successful completion of a degree, don't you think?

Anyway, over the next few days I intend to get around to blogging about all the things I have made handwritten notes about after each of Tim's lectures. (It's true! These notes do exist!)

In the meantime, some useful PHP-related sites/pages I have come across can be found at:

I could extend on that last point - the point about purchase referrals and linking purchasing habits to a user's login. This "intelligence" is a little limited. Using the Amazon example again - if it were a "bricks and mortar" bookstore, I could walk into that bookstore looking at books on crochet for my mum, and WWII for my dad. If I buy these books, it doesn't mean that I want to be mailed every time a new crochet or WWII book is published, nor does it mean that people interested in crochet are necessarily interested in WWII.

(I can't help but feel that blogging is one part useful, and nine parts "wank") ;)

Tuesday, 20 March 2007

Learning Proposal

My project/learning proposal - a slightly altered version of what was outlined in my previous post, can be found at http://students.mim.iml.uts.edu.au/users/10539423/Project-Proposal/LearningProposal-JD.html

Tuesday, 13 March 2007

Proposed Project for Digital Media Technologies

For my project I would like to create PHP pages to update an online ad (built out of Flash), which uses XML script to feed values into the ad.

An ad for an airline might need to have ticket prices updated every few hours – without using dynamic data, a new Flash creative would need to be built each time, and re-trafficked etc. An alternative would be to build a Flash “shell” that read an XML file, and the XML file could be updated via PHP script that would change the values of the fields/XML placeholders.

There could also be log files created that displayed what time/date changes where made and what values were updated. Log files could be replaced by a MySQL database. Not sure if creating log files or a MySQL database for this project is realistic, or if I would be over-extending myself (probably the latter).

I intend to create the PHP pages and the XML script. I can have a colleague of mine create a simple Flash shell (I have almost no ActionScript knowledge and it is not part of this course’s syllabus).

Thursday, 8 March 2007

Nokia Develops Mobile Ad Server

Well, aren't Nokia pro-active little handset manufacturers? ;)

http://www.adotas.com/2007/03/nokia-enters-mobile-ad-business/

One of the biggest challenges in mobile ad serving at the moment is trying to standardise ad formats, as well as the MIME types and display sizes of the phones that receive the ads.

There are third-parties who provide handset data to ad servers to enable targeted serving of ads, and various ad servers are developing technology to serve to handsets and track campaign success and unique users. There are still lots of grey areas, and that's not even taking into consideration the different networks and how THEY operate.

For Nokia to take on the task is pretty ballsy (and man do I wish I had their budget to invest in "sticking-neck-out" ventures). If their offering works and becomes the easiest way for advertisers to start using mobile campaigns, Nokia's existing phone specs may heavily sway the decisions made around how and what to standardise - just as TCP/IP standardised communication across the Web.

Wednesday, 28 February 2007


I'm only doing this because they made me... Still, I'm hardly innocent... I do, however, work for a Third Party Ad Serving company. Now that I've explained myself - lets continue.