AKA Marketing.com Logo            VISIT THE BLOG            

Blogged thoughts, is our web blog. Expect views, opinion, rants and tirades about everything and anything 

« Home / Forums »        

 


Subscribe to our SEO / IT related blog by entering your email address below

Blogged thoughts

| by the www.akamarketing.com team

Archive for January, 2008


Optimizing PDF files for the search engines

Thursday, January 31st, 2008

Google and the others can handle them pretty well these days, but there are certain things you can do to make the lives of the search engines ever so slightly easier. The main things which pop into my mind at the moment include the below, which incidentally are not in any particular order of obviousness.

Use Keywords in the PDF filenames
Having keywords in your filename helps the search engines to better understand the contents of your PDF.

Don’t create PDF files from scans
If you scan a document and save it as a PDF. The document will be an image which search engines cannot understand. Create your PDF from textual content.

Use well structured keyword rich content
This is a given for information stored in any format. Use your main keywords a couple of times throughout the body of your content. Split the content into well defined paragraphs and headings. Give special attention to the first line or two of text on page one of your PDF.

Complete the ‘Document Properties’ information for all PDFs
When creating a PDF go to File > Properties to update it’s information. Updatable information includes title and description fields. It is widely believed that Google and perhaps many of the other search engines can read this information and may be using it for a) determining ranking and b) displaying listing snippets.

Link to your PDF with its Keywords and or Title
Don’t ever have ‘Click here’ as the actual link text pointing to a PDF. If your PDF is about gardening, business loans, soccer or whatever well then put them keywords into the anchor text.

There are a couple of good blog posts and articles which cover this topic in a fair bit of depth, if you have the time I recommend throwing the eye over the following pages:

Make your PDFs work well with Google (and other search engines) located @
http://www.acrobatusers.com/articles/2006/02/pdf_for_google/pdf_for_google.php

Eleven Tips For Optimizing PDFs For Search Engines located @
http://searchengineland.com/070912-095906.php


RingJohn.com site redesign

Thursday, January 31st, 2008

Just noticed the other day that Guinness Enterprise Centre based Internet marketing company Ring John has put a new version of their website live. I’m not sure if it’s the final version of the redesign but it appears to be a big improvement on the previous site. The old version used the very much clichéd variety of stock images of some very good looking blonde women to ‘entice’ all us one track ponies to contact them. I personally think the use of images like that is A) very template-ish (new word) and commonplace and B) so tack that it actually turns me off a company.

Thankfully the new site doesn’t use them. The new homepage puts emphasis on what the company does, with PPC and SEO services seemingly getting more prominent positioning than other services available. Of course the customer capture form is present above the fold, any online marketing company worth their salt will have a similiar page setup. The site is easy to navigate and seems to have a decent information architecture behind it which sees each service page breaking off into well defined sub service pages.

The site kind of reminds me of WebTrade’s website, note the emphasis on the ‘kind of’. The one thing I don’t like about the site is how the link to the blog is buried on the bottom footer. Is this another case of a company overlooking the massive benefits of pushing their business blog on their website? Blogs are an excellent way for potential customers to get to know your expertise, approach, vibe etc. for that reason I nearly would have thrown the blog link up onto the main header navigation bar similar to the way IQ Content and RedFlyMarketing have done.

Of course what I think about a certain site doesn’t really matter, what matters at the end of the day is whether or not a site works. The main metric as far as I’m concerned in measuring how well a site works is conversion rate, so if this redesign or indeed any redesign improves conversion rate that redesign should be considered a success. Are things ever that black and white though?


Reordering columns in a DataTable

Tuesday, January 29th, 2008

Recently while working in my Data Access Layer (DAL) I pulled data from two different databases and combined them into a .Net DataTable before returning that DataTable to my business logic layer (BAL) for.. well business logic stuff. Since I could not find an AddAt() method for adding columns at a specific index I had to try and find a way to reorder columns after adding them. I found the solution on forums.asp.net and it’s actually very easy to do. Suppose you had a DataTable named ‘dt’ and column named ‘Staff Number’ which you wanted to be in at column/index 0 in your datatable. The following line of code is all it takes.

dt.Columns["Staff Number"].SetOrdinal(0);The columns that follow ‘Staff Number’ will all shift across by 1. Incidentally DataTable.Columns[] has two overloads, one which takes a zero-based index of the column to return and another that takes the column name of the column to return. While accessing columns via index numbers is quicker it’s not recommended as it’s too difficult to maintain and read. Imagine for instance I had code which accessed various columns from the ‘dt’ DataTable via an index number and then I realised that I wanted my ‘Staff Number’ column to be first and thus set its index or Ordinal to 0, I would then have to change my index based statements for all columns that were shifted by 1. Since this has the potential to be a royal pain and since my development team would rather read dt.Columns["COLUMNNAME"]; than dt.Columns[INDEXNUMBER]; I always recommend using Column names for accessing data from things like DataTables, DataSets and SQL statements.

The columns that follow ‘Staff Number’ will all shift across by 1. Incidentally DataTable.Columns[] has two overloads, one which takes a zero-based index of the column to return and another that takes the column name of the column to return. While accessing columns via index numbers is quicker it’s not recommended as it’s too difficult to maintain and read. Imagine for instance I had code which accessed various columns from the ‘dt’ DataTable via an index number and then I realised that I wanted my ‘Staff Number’ column to be first and thus set its index or Ordinal to 0, I would then have to change my index based statements for all columns that were shifted by 1. Since this has the potential to be a royal pain and since my development team would rather read  than  I always recommend using Column names for accessing data from things like DataTables, DataSets and SQL statements.


.Net Framework Generics overview

Sunday, January 27th, 2008

I’m using .NET Generics a lot lately in my code so I thought I’d give a quick overview of what they are and what the advantages of using them while developing are. I like About.com’s definition of them and thus I’ll offer it here:

“Generics is a form of abstraction in developing code. Instead of writing a function or a class for a particular type, it can be written generally to use any type. When an instance of the generic class is instantiated, the type is specified.”

Generics have been around in other programming environments for a while however they are new to the 2.0 version of the .NET framework. In the framework they are used mostly by various collection classes, which are used to store items in memory for later retrieval. In C# creation of a generic collection such as a List requires the use of angle brackets (< >) within which you specify the specific type or types you want to use. The line below instantiates a List set up to store ints only:

  1. List<int> intList = new List<int>();

intList can now be used just like any regular non generic collection. Any attempt by the developer to add anything other than an int to the intList collection will result in a compile time error, thus generics are said to be type safe. Generic type safety is discussed next.

Generics offer a number of advantages including type safety, more elegant code and alleged performance improvement.

Type Safety
Generics provide type safety as once a generic class, interface etc. is instantiated with a specific type or types the framework will not allow your code to compile if you then try to inadvertently use a wrong type(s) with your class, interface etc. Compare this with say using a non generic object such as an ArrayList. Since an ArrayList stores instances of the object class you can store any .Net object as everything derives from object.

Imagine intending to use an ArrayList to store strings but you mistakenly also store a int. The compiler will not complain about this, however when you go to retrieve objects from the ArrayList and attempt to cast each of the objects to strings the runtime will throw an InvalidCastException error as you will have attempted to cast an int to an string. Here’s some C# code which should illustrate this a little better:

  1. ArrayList stringList = new ArrayList();
  2. stringList.Add(“1″);
  3. stringList.Add(“2″);
  4. stringList.Add(3);
  5.  
  6. foreach (string i in stringList) //runtime error as collection contains an int
  7. {
  8. string theString = i;
  9. }

As ArrayList is not a type safe class the above code error will not be caught by the compiler. It will however throw a runtime error as you are attempting to cast an int object to a string object. Now see equivalent code using List<>, the generic version of the ArrayList class.

  1. List<string> stringList = new List<string>();
  2. stringList.Add(“1″);
  3. stringList.Add(“2″);
  4. stringList.Add(3);
  5.  
  6. foreach (string i in stringList)
  7. {
  8. string theString = i;
  9. }

Again your attempting to add an int when your purpose is to add only strings. This time however because you have specified a type (string) at creation time, the compiler knows that stringList.Add(3); is invalid and comes back with The best overloaded method match for ‘System.Collections.Generic.List.Add(string)’ has some invalid arguments error message meaning this section of your code is type safe and will never throw an invalid cast type of exception at runtime.

More elegant code & Performance Improvement.
Microsoft lists performance improvement as a benefit of using generics due to the fact that since you specify your correct type or types at time of creation for an object there is no need to use casting as you can be guaranteed your object contains/uses items of a certain type. Casting requires boxing and unboxing. Boxing relates to converting a value type to a reference type while unboxing relates to converting a reference type to a value type. Both steal processor time and slow performance. Many developers however conclude that the performance benefit from using generics is negligible.


Cannot have multiple items selected in a DropDownList

Sunday, January 20th, 2008

I said I’d share this information about how to resolve this error since it took me almost a whole day to fix it. The ‘Cannot have multiple items selected in a DropDownList‘ exception will be thrown when the developer attempts to select a ListItem in a DropDownList when an item in that same DropDownList has already been selected earlier in previous code.

When searching on Google and the forums.asp.net site most of the suggested fixes to this problem suggested explicitly deselecting all selected items in a dropdown before selecting another. This can be done via something like ddl.clearselection() or ddl.SelectedIndex = -1. It seemed like a fairly logical approach, however it did not work for me, no matter what variation of deselection I tried.

On further investigation, it seemed the problem stemmed from the fact that I was adding the same ListItem to multiple dropdowns like so:

ListItem areaItem = new ListItem(Areas.Rows[i][0].ToString(),Areas.Rows[i][0].ToString());
ddlArea.Items.Insert(i, areaItem);
ddlArea2.Items.Insert(i, areaItem);
ddlArea3.Items.Insert(i, areaItem);
ddlArea4.Items.Insert(i, areaItem);
ddlArea5.Items.Insert(i, areaItem);

but because a ListItem object is a reference object when I changed the selectedItem (and by doing so set a particular ListItems selected property to true) property of say ddlArea4 I also changed it in all the other dropdowns which contained the ListItem which was now selected. Remember reference objects do not keep a copy of an object they simply store a reference to the original object, thus a change in one dropdown list was leading to a change in all so code like the following which aims to explicitly deselect items before selecting another would not work:

ddlArea4.ClearSelection();
ddlArea4.SelectedIndex = -1;
ddlArea4.Items.FindByValue(itdp.Rows[2][1].ToString()).Selected = true; //the ListItem that this will select is present in multiple dropdowns, if any of them have anything selected an error will be thrown

The solution to the problem is to create new instances of ListItems for each option you need to add to dropdown lists, so instead of the first bit of code above, I tried something like:

ddlArea.Items.Add(new ListItem(Areas.Rows[i][0].ToString(),Areas.Rows[i][0].ToString()));
ddlArea2.Items.Add(
new ListItem(Areas.Rows[i][0].ToString(),Areas.Rows[i][0].ToString()));
ddlArea3.Items.Add(new ListItem(Areas.Rows[i][0].ToString(),Areas.Rows[i][0].ToString()));
ddlArea4.Items.Add(
new ListItem(Areas.Rows[i][0].ToString(),Areas.Rows[i][0].ToString()));
ddlArea5.Items.Add(new ListItem(Areas.Rows[i][0].ToString(),Areas.Rows[i][0].ToString()));

It meant when I selected a particular ListItem in a particular dropdown only the one ListItem and dropdown was affected. It worked well and it even allowed me to remove the extra deselection logic which in this case it turned out I did not need.

This was quite an uncommon scenario that led to this problem and tracking down the solution was difficult. I think in over 90% of cases the problem with the “Cannot have multiple items selected in a DropDownList” error would come from the developer trying to select more than one item in a DropDownList in a more obvious way such as simply having two or more .Selected = true statements perhaps in different parts of his or her code without realising. Therefore always give something like ClearSelection() or SelectedIndex = -1 a go first before thinking too hard about this problem, it will most likely resolve it.


"Another hour later and you'd all be dead"

Saturday, January 19th, 2008

Not related to what I usually ramble on about but I feel this story deserves to be told. Last night (Friday 18th Jan) at around 11:30 - 12:00ish in the family home we had a fire which started in the washing room at the back of the house when the clothes dryer overheated and went up in flames.

I had put two towels into the clothes dryer around 10 o’ clock so when I got up the next morning I could hop straight into the shower. Sometime in between half 11 and midnight while in my room I smelt smoke, seconds later I heard commotion from the others in the house. I ran down from the attic to the hall door and noticed that a) everyone (including the pet dog) was out in the garden in double quick time and b) a fire had taken hold of about 1/3 of the partition wall/roof between our washing room and sitting room. The wall that separates these two rooms had perspex windows so needless to say it would not have taken long for a fire to spread from one room to another.

Quick evaluation of the situation led me to conclude that it was an acceptable risk to try and put out or at least stem the fire myself before the fire brigade, who had just been called arrived. I ran back upstairs and grabbed a powder fire extinguisher as I was not sure of the source of the fire at the time. If the source of the fire had been electrical and I had started chucking water on it it would have made it worse, however if it was something else at least I knew powder would not make it worse. After opening the sitting room door I was greeted with thick smoke so couldn’t really see well, however I simply pulled the pin and tried to spray towards the base of the bright blur, because the fire was moving upwards on both sides of a wall the bottom of the fire one second was not necessarily the bottom of the fire the next so I then decided to just spray upwards to try and cover all the fire, it seemed to work well. It seemed the first fire extinguisher was empty after only 2/3 seconds, we had a second one on the landing window which I needed as the fire was not yet out. Thankfully after that one was emptied I was confident the fire was out, and by this stage the smoke was starting to get in my eyes and lungs and billowing all over the house so I didn’t stick around to investigate and left the house.

Two fire brigade engines arrived about 15 minutes or so later. There must have been about 20 guys, they all went in and made sure the fire didn’t reignite as often happens, they also checked for structural damage. Thankfully there was none and about two hours later we were allowed back into the house. The fire chief whose name was ‘flood’ (I couldn’t help cracking the joke that he’d be useful in the event of a fire) confirmed that the fire had started in the clothes dryer. He said that this was the stations second dryer related fire that night. He continued to say that in his experience dryers are responsible for causing more fires than any other household electrical appliance and that they must have their filters cleaned regularly so as not to overheat and catch fire.

When all the smoke cleared out and after seeing the damage properly we all agreed that it was not that bad and that it could have been a lot worse, the main thing of course was that everyone was OK, in fact the fire chief commented: “Another hour later and you’d all be dead” in relation to the starting time of the fire, everyone was settling down for bed when the fire started so we did not think his comment was just scaremongering, on the contrary his comment made us realise just how lucky we were.

As mentioned before the main thing in this (and any) fire is that everyone is all right, concerns about the property did and must come secondary, however considering the fire brigade took about 15 mintues (through no fault of their own - traffic, ramps etc.) to arrive I’m sure glad I had that second fire extinguisher as otherwise the whole house would have been gutted. Incidentally I ‘won’ that second fire extinguisher as part of a home safety kit during safety week in my company only a while ago. I’m convinced that if I didn’t win it my family wouldn’t have been going back into the house after two months never mind two hours. Needless to say we will be stocking up on fire extinguishers (and other fire safety equipment too of course) after this. In this case it’s important to note that everyone was out very very quickly (which we are all quitely proud of each other for) so fire extinguishers in this particular instance saved property not lives, next time they could save lives… if you have them, they definitely won’t if you don’t.

I’ve included a good few pictures of the damage below. Click on the descriptions to view the pics.

This is a view from the washing room. The fire started near the bottom right of the photo. It quickly spread up the walls and through to the adjacent sitting room.

This table is just in front of the partition between the two walls.

View from the washing room looking through to the sitting room.

Sut from the smoke settling on the kitchen table. Notice the finger marks which show just how thick the sut cover was.

The clothes dryer was the source of the fire. The fire brigade removed it and a gas canister from the washing room.

This photo shows extensive roof damage. The fire spread to the sitting room via the perspex windows which you can see in the bottom right of the photo.

View of roof damage in the sitting room. The natural colour of the roof is pure white.

View from the sitting room looking across at the roof and the burnt out windows/partition wall area.

This is where the washing machine and the clothes dryer usually are. The center of the picture is where the fire started out. The fire chief believed that the dryer had overheated and thus went up in flames.

This is a straight view from the sitting room into the washing room. I used the fire extinguisher from this position. I initially sprayed the bottom of the windows and then aimed towards the roof/top of windows.

View of roof damage from the washing room. The fire started in the clother dryer to the bottom right of the photo.

Roof damage just to the left of the source of the fire. Notice the melted light.

Two empty powder fire extinguishers. We had one in the house, the other one I ‘won’ in work. If I hadn’t had the 2nd fire extinguisher I believe the house would have been entirely gutted.

HOME | ABOUT US | CONTACT US | SITEMAP | GOOGLE SITE SEARCH | TOP
12 Lorcan Crescent, Santry, Dublin 9, Ireland +353 87 9807629