Jul
09
2009
0

Serving Google KML and KMZ files from IIS

By default, Microsoft IIS only supports a small number of files. This is what you need to support KML and KMZ files in IIS.

The MIME type details are:

Extension: .kml
MIME type: application/vnd.google-earth.kml+xml

Extension: .kmz
MIME type: application/vnd.google-earth.kmz

If you need to know what to do with these mime types, I have a step by step guide for setting up RSS files at http://www.john.geek.nz/index.php/2009/06/supporting-rss-files-in-iis/ – Just use the different extensions and mime types.

Written by John Burns in: General Randomness,PC Tips |
Jun
16
2009
0

Erasing a drive that shows as "Healthy (GPT Protective Partition)"

I’ve recently pulled a drive out of Windows Server 2003 and tried to use it in Windows XP.

When connected, it shows up as “Healthy (GPT Protective Partition)”. I can’t assign a drive letter to it, format it or even repartition it.

Firstly, if this had data on it, you’ll need to go back to Windows 2003 or use a Linux Boot CD to extract it.

If all you’re trying to do is format it for use in Windows XP, read on….
(more…)

Written by John Burns in: PC Tips |
Jun
15
2009
1

Supporting RSS Files in IIS

Microsoft IIS does not support RSS files by default. Here is a step by step guid eto enabling it.

If you’re impatient, already know your way around IIS and just want the MIME type details, they are:
Extension: .rss
MIME type: application/rss+xml

Otherwise, if you need more information, read on…..
(more…)

Written by John Burns in: PC Tips |
Jun
15
2009
0

Sandisk Cruzer – Making them work like a standard USB stick

I just brought an 8GB Sandisk Cruzer USB stick. Unfortunately whenever you plug it in, it comes up as both an emulated CD-ROM drive and the removable disk. the emulated disk comes up as “U3 System” and it tries to run backup/sync software called U3 Launchpad.

Some people enjoy these extra “benefits”, but I’m not a big fan of the bundled software and just want 8GB of storage space I can call home.

If you want to remove the built in software and just use it as a memory stick, you’ll want to use the U3 LaunchPad Remover from Sandisks’ Website. The link to it is: http://www.sandisk.com/driverdownload/download.asp?driverId=2

Written by John Burns in: General Randomness,Mac OS X Tips,PC Tips |
May
05
2009
0

Testing websites with multiple versions of IE

One of the most annoying tasks I have to do when I’m developing a website is to test it in the many different browsers and in some cases, multiple versions of each.

Internet Explorer is the most difficult to test. Windows typically only allows one version of IE to be installed and no two versions will render a page the same. Add to this the frustration that a huge percentage of users still use Internet Explorer version 6 (Come on people, IE6 will be 8 years old this August!) and you’ve got a real problem on your hands.

Until now….
(more…)

Written by John Burns in: CSS tips,PC Tips |
Apr
25
2009
0

Deleting files based on their Date

If you are perfoming regular automated backups (like you should), You’ll soon find you are running out of space and need to start deleting old backups.

Here is a really simple way to delete files that are more than x days old.

It can easily be worked into a batch file to be run at the same time as an automated backup.


Forfiles -p c:\path -s -m *.* -d -14 -c "cmd /c del /q @path"

Change the *.* to a more specific file mask (eg: backup*.zip). The 14 specifies files older than 14 days, so change this to suit your purposes.

If you want to check what files will be deleted, this will display them:

Forfiles -p c:\path -s -m *.* -d -14 -c "Cmd /C Echo 0x22@Path\@File0x22"

Written by John Burns in: General Randomness,PC Tips |
Mar
27
2009
0

Image Editing in C# – Contrast

When attempting to get machines to process images you sometimes run into noise problems. Filters are regularly applied first to clean them up.

Editing the contrast of an image changes its dynamic range. In its most basic form, it will move pixel values away from the center (normally 128 if using 8 bits per color).

There are many different ways to to perform contrast adjustment.
(more…)

Written by John Burns in: C# Tips |
Mar
23
2009
0

Image Editing in C# – Greyscale

I’m in the process of writing some code to detect the stars in astromical images. One of the filters I need to apply to an image is to convert it to greyscale.

Conversion to greyscale is relatively straightforward – The red, green and blue values of a pixel all need to be set to the same value.

There is one caveat, and that is that our eyes are sensitive to different colors. This means that color images tend to have lots of blue and red when compared to green.
(more…)

Written by John Burns in: C# Tips |
Mar
13
2009
1

TLEs – Calculation of the Julian Day Number (JDN)

This post is part of a series on understanding the meaning behind the values contained in a Two Line Element set, or Keplerian Elements. The main article is here.

Calculation of the Julian Day Number (JDN)

Julian day numbers are regularly used in astronomy instead of a date.

Julian day numbers are simply the count of days that have elapse since noon on January 1, 4713 BC Greenwich time using the Julian proleptic calendar.
(more…)

Written by John Burns in: Astronomy,C# Tips |
Mar
10
2009
0

Code: Shortest distance between any two line segments

I recently needed to find the shortest distance between any two line segments in 3D space.

I managed to find some C++ code online at http://softsurfer.com/Archive/algorithm_0106/algorithm_0106.htm which I converted to C#.

It’s fairly easy to use. If you only need it for 2D space, just set the Z values to 0.

Please post a comment if you find this useful.
(more…)

Written by John Burns in: C# Tips |