Höhenprofil mit GPSBabel / XCSV-Format

GPSBabel kann neben Formatkonvertierungen auch in begrenztem Umfang Auswertungen/Berechnungen im XCSV-Format durchführen. Eine Möglichkeit z.B. ein Höhenprofil zu erstellen, besteht

gpsbabel -i gpx -f filename -o xcsv,style=style_height_profile.txt -F filename_height_profile.csv

In style_height_profile.txt steht dann sowas drin:

DESCRIPTION Heigh profile
EXTENSION csv
FIELD_DELIMITER COMMA
RECORD_DELIMITER NEWLINE
PROLOGUE Distance,Altitude
# DATA FIELDS
IFIELD PATH_DISTANCE_KM,"","%f"
IFIELD ALT_METERS,"","%.0f"

Weitere Informationen siehe GPSBabel-Doku.

Dubletten in SQL-Datenbanken finden

Gegeben sei ein Tabelle t, die Dubletten in der Spalte s hat. Außerdem hat die Tabelle noch einen Primary Key in der Spalte id.

Folgender Code findet die Dubletten:
[geshi lang=sql]
SELECT t1.s, t2.s FROM t AS t1, t as t2
WHERE ( (t1.s=t2.s) AND (t1.id < t2.id) ); [/geshi] Würde "t1.id<>t2.id” stehen, würden alle Dubletten zweimal auftauchen. Sollen Dubletten aus zwei verschiedenen Tabellen abgeglichen werden, hat man diese

Sending emails with windows scripting host

You can send emails from within Windows scripting host with the following code (VBS in this case):

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "My Subject"
objMessage.From = "From Header"
objMessage.To = "Recipient Address"
objMessage.TextBody = "text in body"
objMessage.AddAttachment("Path/to/file")
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mailserver.example.com"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send

This should work with all recent Windows versions, starting at least with Windows XP as CDO message gets installed by default.