Mumbo Jumbo
Some useful and some not so useful ramblings...
Tuesday, July 13, 2010
Thursday, July 8, 2010
Check Internet Connectivity
How to check is your PC/ Server is connected to the internet.... there are more than one ways to do that - using wininet.dll, calling for DNS resolution, pinging a internet server, calling a web page and checking for response status and as I wanted to be sure that client is able to reach my server so put them all together.
Friday, July 2, 2010
Multithreaded Singleton in C#
Many a times you run into scenario where only one instance of a class should be created in your application. If you need to know more about Singleton pattern, this article "Singleton pattern" provides good reading. There are quite a few ways to implement this (singleton) but after doing some search on the net found this one to be best for my case.
Tuesday, June 29, 2010
Get Unix Time/ POSIX Time in c#
Recently needed to convert the time into Unix format in C#. Since the Unix time format is basically a count of the seconds passed since 1/1/1970 (Unix epoch), this can be easily done using the DateTime object.
If you are trying to convert some other DateTime value to POSIX time, make sure that it is first converted to UTC.
int unixTime = (int) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
If you are trying to convert some other DateTime value to POSIX time, make sure that it is first converted to UTC.
Labels:
.Net,
C#,
csharp,
Microsoft,
POSIX time,
unix epoch,
utc
Error creating Virtual Port in 64bit Vista/ Windows 7 GPSGate
If you getting error 1275 while creating virtual port for GPSGate in Vista/ Windows 7 64 bit, here is the fix from their forums..
If you use 64-bit Vista or Windows 7 please follow those steps.
(If you are unsure, simply install GpsGate normally first, if Virtual ports does not work - follow those steps)
If you use 64-bit Vista or Windows 7 please follow those steps.
(If you are unsure, simply install GpsGate normally first, if Virtual ports does not work - follow those steps)
Subscribe to:
Posts (Atom)