Sunday, 29 August 2004

Contact Me

I've been trying to think of a way to get a general 'contact me' link up that doesn't put a public email address on the web - I get enough spam already, thanks. While I have a triple-pronged approach (Cloudmark SpamNet for known-spam, SpamBayes for heuristic scanning, Brightmail at my [mail] ISP) I still have to download the stuff that gets through Brightmail - about 16 items per day at present, about 25% of which are actually non-delivery reports where someone's used a fake sender address with my domain in it.

Anyway, enough digression. If you want to just send me stuff, please reply to this post. I'll try to delete your comment after I've dealt with it, if you want me to. I'll put a link to this post in the sidebar. If you don't want to register, please just use the anonymous comment facility; if you do leave an anonymous comment, please leave your name!

24 comments:

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

What about encoding your email address and decoding it with Javascript when loaded? I doubt spambots are coded to understand Javascript. Or put it in an image, mutiliating as necessary.

-John Pham

Anonymous said...

Hi! I read your article about the TimezoneInformation class at CodeProject. I also needed the two missing methods that you left out in your implementation, IsDaylightSavingTime() and GetDaylightChanges(), which I implemented in a class based upon yours. Interested in the source? Drop me a message at 2bca10b20417539fbaa6a852be83561c@one.ditt.as.

Anonymous said...

Hi there Mike.

Sorry to trouble you, but to make a long story short, I recently graduated from university with a Bsc in Computer Science (Hons) with a worse than expected result. There are a few reasons, mostly to do with an emotional breakup at the time and the alcohol consumption that followed. I basically got a 2:2 and have felt pretty depressed about it (I basically felt like a loser).

I know this isn't the most positive thinking to have, but have since been trying to look for work in my field and for many other reasons, I'm having difficulty, but I was browsing the internet and found a mention on your blog that you got the same result. I was hoping that you might perhaps give me advice on how you managed and how to deal with the anxieties and what kind of future prospects (ok, sounds very official, i know) are possible or what you have done atleast. I'm quite a skilled programmer and generally competant, but what I worry is that I don't know how to get this across. Grades seem like everything... and I'm having a bit of a confidence issue

Well, I'd be very happy to hear back from you.

My email address is jorgeprimm@hotmail.co.uk

Take care,
Jorge

James Macintyre said...

I read with interest that you are developing or have developed an application for the symbol mc3000. I have just spent the last 3 days trying to get my head around embedded C++ after symbol told me that the .net application framework would not work. I am now working in .net in vb.

What language was the application you used for new look coded in?

i am currently working on a system for our warehousing staff to run on the mc3000 and to interact with some Fox Pro tables, fox pro is my normal choice of programming applications and so the symbol unit is proving a challenge.

Any help, samples etc you could send my way would be very appriciated.

Please email me james at letterbox.co.uk



Warm Regards


James

Anonymous said...

i liked WorldClock sample you posted in codeproject.com. thanks

just pointing a small mistake in your code. sometimes CurrentTimeZone will return null object. This happens when Daylight Saving time is not used and there are 2 different name for Standard and Daylight names in registry. In this case Standard and Daylight names will be same if u use GetTimeZoneInformation function to get these values. it can be solved using return value of the same function.

thanks again for the code.

Anonymous said...

Hi Mike,
I see you comment on a lot of blogs and you seem to really know your stuff. Why don't you come help out on ReactOS or Wine?

Thanks
Steven

Anonymous said...

Hi Mike
I've recently started a new job developing Data Capture applications on CE.NET devices. I'm having a great deal of trouble working with timezones , (S)NTP and daylight savings. If you could spare me some time? i am contactable at chris@christopherbird.co.uk
Thanks, Chris

Anonymous said...

I found your WorldClock code and found it very useful. CodeProject makes reference to including any copyright information if this is to be used in a commercial application, I was just curious what your official position on the copyright for this TimeZoneInformation class was. Is it free to use/modify for a commercial app?

If you could reply to
fraschetti AT gmail dot com
I'd appreciate it.

Thanks again!

Anonymous said...

-Mike

Thanks for posting the excellent TimeZoneInformation class to CodeProject.

I would like to ask your permission to use the TimeZoneInformation class in a commercial application.

I may be reached at Greg.Nelson@avistainc.com

Thanks again.

-Greg

javierdiazjr said...
This comment has been removed by a blog administrator.
javierdiazjr said...
This comment has been removed by a blog administrator.
twatty said...
This comment has been removed by a blog administrator.
Italy Dude said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Hi,

We have a Windows Service which runs office automation using MS Office COM objects. It used to work fine with Win XP and Vista Beta1, but it no longer works with Vista RC1.

When we call IDispatch->Invoke "Open" of the Word Application Object, we get an error ("Open") failed with error 0x800a13e9.

Could you please help

Thanks and regards,
Mridu

neha said...

Hi Mike,
Here I need a small favour from your side. I am working with a software comapny. I used the concept your world Clock application in one of my application. Now i want to share the knowledge acroos my organisation through the knowledge repository we use here. but to upload the document i need your written permission so that it does not voilate our policies.
The document would be published with your reference and the method how did i use window's registry concept in the project.

I hope you would allow me to share the knowlege with thousands of people work with me organisation.
Also i can send you the document , if you provide me your e-mail id.
Thanks And Regards,
-Neha
id:mystiqueneha@gmail.com

Mariusz said...

I like this site beacuse by reading your blogg and comments I can learn a lot about programming. I am a computer science and sometimes I have some errors in my programs in Java. So, now I know where can I get some help.

Anonymous said...

Hi Mike

Andy Lowe's "10 Known Bugs" now on www.exnetsystems.co.uk

Regards
Brian Morris

Anonymous said...

--prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-curl --with-dom --with-dom-xslt --with-dom-exslt --with-gd --enable-mbstring --with-mcrypt --with-mhash --with-mysqli --with-openssl --enable-sockets --enable-track-vars --with-ttf --enable-gd-native-ttf --with-zip --with-zlib

Rosie said...

I thank you for your comment.

duraid said...

Hi Mike,

I'm using your TimeZone code in my project and it seems that it's miscalculating day light saving switch date for eastern standard time. The code below switches to eastern daylight time on March 2, 2007 and i tested with the windows clock on the same computer and it switches at the right time March 11, 2007. Has there been a update to the code. here is the class im using:

namespace eAcademy.Library.Business
{

internal partial class TimeZoneInformation
{
#region Fields
private TZI tzi; // Current time zone information.
private string displayName; // Current time zone display name.
private string standardName; // Current time zone standard name (non-DST).
private string daylightName; // Current time zone daylight name (DST).
private static readonly List[TimeZoneInformation] timeZones; // List of all time zones on machine.
#endregion

#region Constructors
private TimeZoneInformation()
{
}

static TimeZoneInformation()
{
timeZones = new List[TimeZoneInformation]();

using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"))
{
string[] zoneNames = key.GetSubKeyNames();

foreach (string zoneName in zoneNames)
{
using (RegistryKey subKey = key.OpenSubKey(zoneName))
{
TimeZoneInformation tzi = new TimeZoneInformation();
tzi.displayName = (string)subKey.GetValue("Display");
tzi.standardName = (string)subKey.GetValue("Std");
tzi.daylightName = (string)subKey.GetValue("Dlt");
tzi.InitTzi((byte[])subKey.GetValue("Tzi"));
timeZones.Add(tzi);
}
}
}
}
#endregion

#region Public Properties

public static List[TimeZoneInformation[ TimeZones
{
get
{
List[TimeZoneInformation] nList = new List[TimeZoneInformation]();
foreach (TimeZoneInformation tzi in timeZones)
{
nList.Add(tzi);
}
return nList;
}
}


public static TimeZoneInformation CurrentTimeZone
{
get
{
string tzn = TimeZone.CurrentTimeZone.StandardName;
TimeZoneInformation tzi = TimeZoneInformation.GetTimeZone(tzn);
return tzi;
}
}


public string StandardName
{
get
{
return standardName;
}
}


public string DaylightName
{
get
{
return daylightName;
}
}


public string DisplayName
{
get
{
return displayName;
}
}

public int Bias
{
// Biases in the registry are defined as UTC = local + bias
// We return as Local = UTC + bias
get
{
return -tzi.bias;
}
}


public int StandardBias
{
get
{
return -(tzi.bias + tzi.standardBias);
}
}


public int DaylightBias
{
get
{
return -(tzi.bias + tzi.daylightBias);
}
}
#endregion

#region Public Methods


public override string ToString()
{
return this.standardName;
}


public static TimeZoneInformation GetTimeZone(string standardTimeZoneName)
{
if (standardTimeZoneName == null)
throw new ArgumentNullException("standardName");

foreach (TimeZoneInformation tzi in TimeZoneInformation.TimeZones)
{
if (tzi.StandardName.Equals(standardTimeZoneName, StringComparison.OrdinalIgnoreCase))
return tzi;
}
throw new ArgumentException("standardTimeZoneName not found.");
}

public DateTime ToLocalTime(DateTime utc)
{
// Convert to SYSTEMTIME
SYSTEMTIME stUTC = DateTimeToSystemTime(utc);

// Set up the TIME_ZONE_INFORMATION
TIME_ZONE_INFORMATION tziNative = TziNative();
SYSTEMTIME stLocal;
NativeMethods.SystemTimeToTzSpecificLocalTime(ref tziNative, ref stUTC, out stLocal);

// Convert back to DateTime
return SystemTimeToDateTime(ref stLocal);
}


public static DateTime ToLocalTime(string standardTimeZoneName, DateTime utc)
{
TimeZoneInformation tzi = TimeZoneInformation.GetTimeZone(standardTimeZoneName);
return tzi.ToLocalTime(utc);
}


public static DateTime ToLocalTime(string sourceTimeZoneName, DateTime localTime, string targetTimeZoneName)
{
DateTime utc = TimeZoneInformation.ToUniversalTime(sourceTimeZoneName, localTime);
DateTime lt = TimeZoneInformation.ToLocalTime(targetTimeZoneName, utc);
return lt;
}

public DateTime ToUniversalTime(DateTime local)
{
SYSTEMTIME stLocal = DateTimeToSystemTime(local);
TIME_ZONE_INFORMATION tziNative = TziNative();
SYSTEMTIME stUTC;

try
{
NativeMethods.TzSpecificLocalTimeToSystemTime(ref tziNative, ref stLocal, out stUTC);
return SystemTimeToDateTime(ref stUTC);
}
catch (EntryPointNotFoundException e)
{
throw new NotSupportedException("This method is not supported on this operating system", e);
}
}

public static DateTime ToUniversalTime(string standardTimeZoneName, DateTime local)
{
TimeZoneInformation tzi = TimeZoneInformation.GetTimeZone(standardTimeZoneName);
return tzi.ToUniversalTime(local);
}
#endregion

#region Private Methods
private static SYSTEMTIME DateTimeToSystemTime(DateTime dt)
{
SYSTEMTIME st;
System.Runtime.InteropServices.ComTypes.FILETIME ft = new System.Runtime.InteropServices.ComTypes.FILETIME();

ft.dwHighDateTime = (int)(dt.Ticks ]] 32);
ft.dwLowDateTime = (int)(dt.Ticks & 0xFFFFFFFFL);

NativeMethods.FileTimeToSystemTime(ref ft, out st);

return st;
}


private static DateTime SystemTimeToDateTime(ref SYSTEMTIME st)
{
System.Runtime.InteropServices.ComTypes.FILETIME ft = new System.Runtime.InteropServices.ComTypes.FILETIME();

NativeMethods.SystemTimeToFileTime(ref st, out ft);

DateTime dt = new DateTime((((long)ft.dwHighDateTime) [[ 32) | (uint)ft.dwLowDateTime);

return dt;
}

private TIME_ZONE_INFORMATION TziNative()
{
TIME_ZONE_INFORMATION tziNative = new TIME_ZONE_INFORMATION();

tziNative.Bias = tzi.bias;
tziNative.StandardDate = tzi.standardDate;
tziNative.StandardBias = tzi.standardBias;
tziNative.DaylightDate = tzi.daylightDate;
tziNative.DaylightBias = tzi.daylightBias;

return tziNative;
}


[StructLayout(LayoutKind.Sequential)]
private struct SYSTEMTIME
{
public UInt16 wYear;
public UInt16 wMonth;
public UInt16 wDayOfWeek;
public UInt16 wDay;
public UInt16 wHour;
public UInt16 wMinute;
public UInt16 wSecond;
public UInt16 wMilliseconds;
}

[StructLayout(LayoutKind.Sequential)]
private struct TZI
{
public int bias;
public int standardBias;
public int daylightBias;
public SYSTEMTIME standardDate;
public SYSTEMTIME daylightDate;
}



[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct TIME_ZONE_INFORMATION
{
[MarshalAs(UnmanagedType.I4)]
public Int32 Bias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string StandardName;
public SYSTEMTIME StandardDate;
[MarshalAs(UnmanagedType.I4)]
public Int32 StandardBias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string DaylightName;
public SYSTEMTIME DaylightDate;
[MarshalAs(UnmanagedType.I4)]
public Int32 DaylightBias;
}


private struct NativeMethods
{
private const string KERNEL32 = "kernel32.dll";

[DllImport(KERNEL32)]
public static extern uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION
lpTimeZoneInformation);

[DllImport(KERNEL32)]
public static extern bool SystemTimeToTzSpecificLocalTime(
[In] ref TIME_ZONE_INFORMATION lpTimeZone,
[In] ref SYSTEMTIME lpUniversalTime,
out SYSTEMTIME lpLocalTime);

[DllImport(KERNEL32)]
public static extern bool SystemTimeToFileTime(
[In] ref SYSTEMTIME lpSystemTime,
out System.Runtime.InteropServices.ComTypes.FILETIME lpFileTime);

[DllImport(KERNEL32)]
public static extern bool FileTimeToSystemTime(
[In] ref System.Runtime.InteropServices.ComTypes.FILETIME lpFileTime,
out SYSTEMTIME lpSystemTime);


[DllImport(KERNEL32)]
public static extern bool TzSpecificLocalTimeToSystemTime(
[In] ref TIME_ZONE_INFORMATION lpTimeZone,
[In] ref SYSTEMTIME lpLocalTime,
out SYSTEMTIME lpUniversalTime);
}


private void InitTzi(byte[] info)
{
if (info.Length != Marshal.SizeOf(tzi))
{
throw new ArgumentException("Information size is incorrect", "info");
}

// Could have sworn there's a Marshal operation to pack bytes into
// a structure, but I can't see it. Do it manually.

GCHandle h = GCHandle.Alloc(info, GCHandleType.Pinned);

//TimeZone tz;
//tz.ToLocalTime;
//tz.ToUniversalTime;

try
{
tzi = (TZI)Marshal.PtrToStructure(h.AddrOfPinnedObject(), typeof(TZI));
}
finally
{
h.Free();
}
}
#endregion
}
}

hindurevolution said...

Dear Mike,
This is Suman here, I wanted to ask you about some information which would be greatly appreciated.

I have a web-application running in apache server. the application is based on CGI-Perl/JavaScript. Now the server is going to be changed to 'Microsoft IIS 6.0' Can you please tell me
1) whether this new server will support all my existing applications in CGI-Perl without any modifications?
2) if not then what kind of modification it warrants.

Your reply is very much appreciated
Also please mark a copy to 'mailtosumanjr@gmail.com'

Lilly Butterfield said...

Dear Mike: Just read your Friday, December 07, 2007 post "Calling out EMBASSY Trust Suite." I just purchased a new DELL Latitude D830 and that piece of crap came preinstalled. I just tried to uninstall it, and it won't fully uninstall! Just spent the better part of a day searching for answers and haven't been able to find any. This is the error I got: "The Wave Installer could not uninstall the prerequisite Wave Infrastructure. Reason: Could not run Installer. Fatal error during installation." When I try again, I get "AMCustomAction has encountered a problem and needs to close." Got any advice? Many thanks, Laura