Shaun Mccran

My digital playground

14
F
E
B
2009

Internet Explorer 7 and -ms-interpolation-mode css

Whilst working on a recent project I was looking at how IE 7 renders images that have been incorrectly sized in code. There is a css style "-ms-interpolation-mode" that handles stretched images in IE 7.

The msInterpolationMode property works with stretched images only. As an example if the dimensions of an image are 200x200 but the developer has specified height and width of 400x400, then the image will be stretched to the new dimensions using the nearest-neighbor algorithm, unless you override it with this property.

Notice the difference in the overstretched images above?

This can be achieved by adding this code to your style sheets:

view plain print about
1<style>
2img.high { -ms-interpolation-mode:bicubic }
3img.nearest { -ms-interpolation-mode:nearest-neighbor }
4</style>

Note that Firefox handles this automatically.

13
F
E
B
2009

Tomb raider for a tonne?

I noticed this the other day on ebay, seems a bit ambitious if you ask me!

I suppose there is no harm in trying! Althought its only £20.00 on the highstreet......

10
F
E
B
2009

F8 problems when installing Windows XP

I was recently performing a windows XP rebuild for a client, and noticed that when I reached the EULA agreement in windows XP's installation routine I was prompted to 'press F8' to signify that I agreed to it.

The only problem was the F8 key was disabled! It appears that during a rebuild on top of an existing invalid installation of XP, windows will disable the function keys.

It was then that I noticed the function lock key. The Fn key works just like the scroll lock, or number lock keys, except that it disables/enables the function keys!

It was a simple matter to press Fn once, then press F8 to agree to the licence.

Still don't know why they are disabled during the installation though....

04
F
E
B
2009

Mysql left and right functions

When you need to extract specific elements from a column, MySQL has a few functions that can help. I've always found it much easier to provide the data to your application layer in the corrct format in the first place, rather than excessive processing in GUI layer. Suppose I needed to check that column in the table always has a trailing '/' on the column data.
view plain print about
1select     id,
2    name,
3    RIGHT(url, 1) as slash
4    from table
5    where RIGHT(url, 1) != "/"
In the LEFT() function, using the column telephone along with the number of characters to extract, starting from the first character on the left in the column.

The RIGHT() function is similar, but it starts from the last character on the right, counting left to encapsulate the last seven characters.
In the SQL statement below, areaCode is reused to order the results set. To reformat the telephone number, it will be necessary to use the SUBSTRING() function.

view plain print about
1SELECT LEFT(telephone, 3) AS areaCode,
2 RIGHT(telephone, 7) AS telNo
3 FROM contacts
4 ORDER BY areaCode;
5
6 SELECT CONCAT('(', LEFT(telephone, 3), ') ',
7 SUBSTRING(telephone, 4, 3), '-',
8 MID(telephone, 7)) AS 'Telephone Number'
9 FROM contacts
10 ORDER BY LEFT(telephone, 3);

_UNKNOWNTRANSLATION_ /