Archive for the ‘internet’ Category

Converting CSS Properties into JavaScript

Tuesday, June 10th, 2008

There are other examples of this out there on the web but I cna never find one when I need it so have added it to my blog for easy access.

CSS Property JavaScript Reference
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
clip clip
color color
cursor cursor
display display
filter filter
font font
font-family fontFamily
font-size fontSize
font-variant fontVariant
font-weight fontWeight
height height
left left
letter-spacing letterSpacing
line-height lineHeight
list-style listStyle
list-style-image listStyleImage
list-style-position listStylePosition
list-style-type listStyleType
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
overflow overflow
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
page-break-after pageBreakAfter
page-break-before pageBreakBefore
position position
float styleFloat
text-align textAlign
text-decoration textDecoration
text-decoration: blink textDecorationBlink
text-decoration: line-through textDecorationLineThrough
text-decoration: none textDecorationNone
text-decoration: overline textDecorationOverline
text-decoration: underline textDecorationUnderline
text-indent textIndent
text-transform textTransform
top top
vertical-align verticalAlign
visibility visibility
width width
z-index zIndex

Usage

Targeting elements by getElementById seems pretty universal.

document.getElementById('x').style.backgroundPosition = '0 -200px';

It’s raining awads at the moment

Monday, June 2nd, 2008

Another of the products I worked on called Analytics won a French i-expo award.

Some senior manager who I have never met said:

“We are extremely proud to be acknowledged by professionals for the innovating aspect of our LexisNexis Dashboard solution. Our technical team along with our consultants has managed to put technology … “

Anyway more recognition for more hard work.

I won a CODiE award :)

Sunday, June 1st, 2008

One of the projects I worked on called Total Patent won a Codie award for Best Online Science or Technology Service. The exact blurb follows:

“The 2008 CODiE Awards recognize those companies providing the best new technology products and services across a broad array of industries,” noted SIIA President Ken Wasch. “The awards and their winners are a testament to the power of technology to deliver innovative solutions to American businesses and consumers. SIIA congratulates all of the CODiE Award winners and nominees, whose innovation is essential for continuing America’s leadership in the global knowledge economy.”

The winners are viewable on this site http://siia.net/codies/2008/winners.asp.

Its good to know that someone recgnises my genus.

How do claim a refund from Amazon for items that go down in price within 30 days of purchase

Wednesday, May 21st, 2008

Recently I bought a new Canon Ixus 970 compact camera from Amazon when my old Ixus 900 went missing.

It is a great camera and has helped me take some photos that I am really proud of like this one from last weekends 40 mile charity cycle ride in the Cotswolds.

Red British Royal Mail post box in the Cotswolds

I looked at the camera again on Amazon today and the price had dropped by £22.13 so I emailed them and they replied within the hour that they would refund the difference. How cool is that?

This is what they said:

The discounts we offer for items on our website do vary from time to time. I’ve checked your order #026-3229170-8980331 and found that we now offer a greater discount on “Canon Digital IXUS 970 IS Compact Camera (10.0 MP, 5x Optical Zoom) 2.5″ High Resolution PureColor LCD II” than at the time you placed your order.

We are happy to refund the price difference in cases where less than thirty days have passed between the date on which an order was dispatched and the time that an item is reduced in price on our site. Therefore I have requested a refund of 22.13 GBP to your payment card. This amount reflects the difference between the price you were charged and the current discounted price. The refund should appear as a credit on your next bank statement.

Here are the steps you need to take to get a refund from Amazon in future

  1. Any time you buy anything from Amazon (but not the sellers that trade on their site) make a note in your diary for 29 days later to check the price hasn’t changed.
  2. If the price has changed contact them on this form telling them that the price has changed.
  3. Wait for refund and spend on more stuff from Amazon
  4. Go to step 1.

Happy shopping!

I am now a professional photographer

Thursday, May 15th, 2008

Recently I stumbled on this site photopreneur that offers all sorts of advice about professional photography. A day later I got another request for one of my photos on flickr and I asked for some money (normally I just give them away).

Well I have just sold this photo for £30 a copy of the book my picture will appear in and a credit for the photograph.

Blenheim Palace

I think that officially makes me a professional photographer, although I will not be giving up the day job just yet.

May Day is now “RSS Awareness Day”

Friday, May 2nd, 2008

As they say on the rssday.org site:

RSS (Really Simple Syndication) is a format used to deliver information from websites and pages that get updated regularly. An RSS document (which is called feed) contains either a summary or the full content from a website.

The main benefit of RSS is that it enables people to stay connected with their favorite websites without having to visit them. Once you subscribe to a particular RSS feed, you will automatically receive updates from the website that publishes the feed, whenever they release new content. The video below illustrates the process.

RSS Awareness Day

The previous owners of “May Day” the communists and other hard core lefties had a march outside my offices in Holborn London in protest.

May Day march in Holborn, London

Wireless router upgrade

Saturday, April 19th, 2008

I have a shitty old Linksys router that acts as a wireless connection for our whole flat. It often crashes when it gets too busy.

A while ago I saw this article on lifehacker about upgrading the rubbish firmware on my router with opensource software from Tomato.

I umed an ahed about it for months because if something went wrong then we would be disconnected from the internet. Which would not only be a personal tragedy but also would mean I had to have actual real life conversations with my flatmates. More than likely conversations about why I broke the internet. And how I work in IT so I should be able to fix it.

Today I build up the courage to make the firmware upgrade and it took about 2 minutes.

If you have a Linksys router that is causing you problems then I fully recommend upgrading to Tomato.

Converting px into percentage and em for relative CSS font sizes

Wednesday, March 12th, 2008

Recently I have started to get a lot of requests to make certain fonts on my websites this pixel (px) size or that pixel size.

For accessibility reasons I do not use pixels as a measurement of font size. Pixels are what is known in the trades as a fixed font size so they do not resize on some browsers when the user manually changes their browsers font size. The main problem is IE6 which despite all logical sense is an insanely widely used web browser.

So if a visitor to a poorly coded website had difficulty reading small text and they tried to increase the font size in IE6 and a lesser web developer had set the font sizes in pixels, then that user would not be able to read the web page. You could say that page would be inaccessible to them.

Thankfully there are some font size declarations that do resize in all the different web browsers. These are percentage (%) and em (em). I prefer percentages because that is what I started using way back in the day and they still haven’t let me down. But both effectively do the same thing.

To make my life easy I made the following table to convert fixed pixel sizes into % and em. The maths is quite simple. The basic font size on most browsers is 16px which is 100% or 1em. To work out the percentage of 17px I divided 17 by 16 and multiplied by 100. The result is 106%. For em I just divided 17 by 16.

The other thing to note is that web browsers do not display non integer font sizes. So a percent of 105 might display at 17px or 16px depending on the browser.

One final point I should add is that every time you decrease the font size by 1px a certain number of users will no longer read the text. For that reason I do not like to use font sizes under 12px/75%/.75em.

Px Size % Size Em Size
36px 225% 2.25em
35px 219% 2.19em
34px 213% 2.13em
33px 206% 2.06em
32px 200% 2em
31px 194% 1.94em
30px 188% 1.88em
29px 1.81% 1.81em
28px 175% 1.75em
27px 169% 1.69em
26px 163% 1.63em
25px 150% 1.5em
24px 150% 1.5em
23px 144% 1.44em
22px 138% 1.38em
21px 131% 1.31em
20px 125% 1.25em
19px 119% 1.19em
18px 113% 1.13em
17px 106% 1.06em
16px 100px 1em
15px 94% .94em
14px 88% .88em
13px 81% .81em
12px 75% .75em
11px 69% .69em
10px 63% .63em
9px 56% .56em
8px 50% .50em

Note: there might be some subtle differences on less popular browsers.

Find Chuck Norris

Thursday, February 7th, 2008

Type Find Chuck Norris into Google… and press the “I’m feeling lucky button”…

SHOCKED - IE8 passes the Acid2 test

Monday, January 28th, 2008

If you aren’t an internet geek this will mean nothing to you. But to those of us who spend our days coding sites so that they work on all the different browsers and platforms on the wild wild web this is huge news.

The Acid2 test is a complicated web page that will only display correctly on a browser that conforms to a set internationally accepted standards outlined by the W3C. If the web browser that you are using supports web standards then the Acid2 test pages will display a nice smiley face. If it doesn’t then the results will be not such a nice smiley face.

You can click here to see how your current web browser performs on the Acid2 test. It probably doesn’t do too well.

The point is though there are lots of internet browsers out there like Firefox, Safari, Opera etc and most of them are moving towards being fully standards compliant. Microsoft’s Internet Explorer on the other hand is a pile of poorly coded junk and doesn’t even come close to passing the Acid2 test. I guess they always figured that if they pre-packaged their internet browser with the Windows operating system then they would not have to comply to international standards. This is a real bugger for web developers like me because we have to code our sites to work on most of the worlds internet browsers and then we have to code them to work on IE6.

Recently Microsoft has been losing a share fo the browser market to a far superior standards compliant browser called Firefox. To stop the rot Microsoft released IE7 but that was largely based on the original code from IE6 and wasn’t really much better. So it looks like Microsoft have finally gotten the message and built their next internet browser IE8 from scratch so that it complies with the correct international standards. The follow picture from the IEBlog shows that IE8 will comply with pass the Acid2 test.

IE8 will pass the Acid2 test

If this can be believed then it is the most significant development for internet browsers in a long time.