creating a shortcut icon for an iTouch or iPhone for your website

Monday, June 30th, 2008

I noticed that I few websites when I added a shortcut to the home page of my iTouch had really nice icons rather than the default screen shot of their home page. So I went about finding out how to do it and it is dead easy, all you have to do is this:

  1. Open up Photoshop or similar
  2. Create a new image that is 57 by 57 pixels
  3. Pop your image in there
  4. Save it as ‘apple-touch-icon.png’ (Without the quotes but must be that name)
  5. Upload it to the root of your site

Windows XP Pro - Automatic updates won’t run

Saturday, June 28th, 2008

I had not bothered about this for some time - but I thought I had better get it sorted now as I had not updated for a while.

I kept getting the error Automatic Updates, BITS and Event Log services not running. Even if you go to the services list and find that they are running it still does not work.

I found that the problem was with the Automatic Updates service that was not set to start up automatically - probably something I did a while back when I pretty much switched almost all the services off!

Anyway - to solve this problem - right click on the automatic updates service and change its start up mode to automatic, make sure RPC is running and then restart your machine.

That should do the trick!

object references an unsaved transient instance - save the transient instance before flushing

Thursday, June 26th, 2008

Just got this error and to my astonishment it was my error! What a surprise.

I had a many-to-one property in a hibernate mapping and when I was calling saveOrUpdate I got the error: object references an unsaved transient instance - save the transient instance before flushing. Now the transient object was immutable - and my mapping said save it - fool!

To fix it I changed this:

<many-to-one name=”Class” column=”column_id” />

to this:

<many-to-one name=”Class” column=”column_id” update=”false” insert=”false” />

Prototype 1.6 changes to inserting elements

Wednesday, June 25th, 2008

The Insertion object has been deprecated, so when you used to do this:


new Insertion.After($('element'), '<p>jibble</p>');

You now do:

$("items").insert({ after: new Element("p") });
$("items").insert({ top: "<li>an item</li>" });
$("items").insert("<li>another item</li>"); // defaults to bottom

See here for more info:
http://www.prototypejs.org/2007/8/15/prototype-1-6-0-release-candidate

IIS on XP increasing the number of connections - HTTP 403.9 error

Thursday, June 19th, 2008

This can be very annoying sometimes. I know it is not best to be running IIS on XP but sometimes you just have to. When running a local host you may want another member of your team to view your site or you may be running some regretional testing such as selenium test runner and you need to be able to hit the site more than just the once. Instead you just get a 403.9 error.

To alleviate this problem (not fully) you can do the following:

  • remove HTTP Keep-Alives Enabled
  • reduce the connection timeout
  • and then run this: adsutil set w3svc/MaxConnections 40 Found: c:/Inetpub\AdminScripts

http://weblogs.asp.net/cazzu/archive/2003/10/10/31476.aspx

RSS in .NET - next time I will use this

Wednesday, June 18th, 2008

http://weblogs.asp.net/scottgu/archive/2006/02/22/438738.aspx

Got to write some vb - a good resource for functions etc

Tuesday, June 17th, 2008

I do not want to be doing this very often - not a great fan of vb - least of all vb.asp but sometimes you have to do what you have to do.

This seems like a good place for referance:

http://www.devguru.com/Technologies/vbscript/quickref/vbscript_list.html

App_Offline.html in the root of your site

Friday, June 13th, 2008

Interesting - you can switch off a site with one file:

http://weblogs.asp.net/scottgu/archive/2006/04/09/App_5F00_Offline.htm-and-working-around-the-_2200_IE-Friendly-Errors_2200_-feature.aspx

Creating or renewing a cert on a IIS - too easy it hurts

Wednesday, June 11th, 2008

Now this is a really easy one and something I was expecting to be a little more difficult.

To renew a cert in IIS - open up the IIS manager and view the properties of the site you need to renew the cert on. Select the directory security tab and open the certs. If it is a renew go throught the process of creating a cert request.

Use this cert request to generate the private key from the vendor. Once the vendor has sent the cert back, paste the content into a text file and then change the extension to ‘.cer’.

Pop this .cer on the server and then go back to the IIS panel where the request was made. Go through the process and select the .cer just uploaded.

THATS IT! Far too easy.

http://www.geotrust.com/support/generate-csr/

https://knowledge.geotrust.com/support/knowledge-base/index?page=content&id=AR884

rounding to a specific number javascript

Wednesday, June 11th, 2008

Easy peasy lemon squeezy:

7 * Math.round(12 / 7); // returns 14
7 * Math.round(2 / 7); // returns 0

You might also want to check the value is a number too!

isFinite(parseFloat(value))

http://www.webveteran.com/blog/index.cfm/2007/2/19/JavaScript-Round-to-any-multiple-of-a-specific-number