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)
Casting int or string to Enum
Quick note to myself :D
From a string:
From an int:
From a string:
MyEnum foo = (MyEnum) Enum.Parse(typeof(MyEnum), yourString);
From an int:
MyEnum foo = (MyEnum) yourInt;
Monday, June 28, 2010
Windows 7 - "New txt file" missing from right click menu
Few days back realized that somehow I managed to loose the "New txt file" option in the context menu 8O . To fix this
1. Download the fix file given below. (Use Right-click – Save as option in your browser to download the file.)
1. Download the fix file given below. (Use Right-click – Save as option in your browser to download the file.)
Labels:
context menu,
Microsoft,
missing,
new text file,
notepad,
windows,
Windows 7,
windows7
Saturday, June 19, 2010
You cannot debug this SWF because it does not contain ActionScript
Upgrading from Flash CS4 to CS5 ran into great wall of china again 8O .. really man.. I know web is full of posts from people running into this problem then why the hell can't Adobe just make the error message a little less misleading :roll: ... most common reason for this is the code behind is so big that the compiler is running out of memory while compiling the movie.
Labels:
actionscript,
Adobe,
AIR,
AS3,
CS5,
Flash CS5,
JVM Max Heap Size
Font Embedding in Flash CS5
Flash CS5 introduces a new way of emebdding fonts and unfortunately it breaks the older way of embedding fonts :( . The older way of embedding fonts which can be found here , does not work anymore for Flash IDE projects though that will still work for pure AS3 projects. I was using this method only in my project but as soon as I upgraded to flash CS5, text disappeared in my compiled movie. Googling pointed me to these two:
Labels:
actionscript,
Adobe,
AIR,
AS3,
CS5,
Embed Font,
Flash CS5,
Font
Wednesday, February 10, 2010
Embedding font family in AS3
While trying to embed font in AS3 ran into problem. I was trying to embed MyriadPro font into my AS3 application and got error "exception during transcoding: Font for alias 'MyriadPro' with plain weight and style was not found at: file" and like always Googling provided the solution.
Labels:
actionscript,
Adobe,
AIR,
AS3,
CS4,
Embed Font,
Flash CS4,
Font
Tuesday, January 19, 2010
How to make sure your emails dont land in SPAM folder
One of the biggest problems with our clients is to ensure that the legitimate emails they send out to their users/ customers do not end up in the SPAM folder. To ensure that as a website administrator you need to follow the bext practices guidelines provided by Yahoo and Google.
http://mail.google.com/support/bin/answer.py?hl=en&answer=81126
http://help.yahoo.com/l/us/yahoo/mail/postmaster/basics/basics-55.html;_ylt=Ahc6x60yB8n8JzvfVztu4QsIJHdG
http://mail.google.com/support/bin/answer.py?hl=en&answer=81126
http://help.yahoo.com/l/us/yahoo/mail/postmaster/basics/basics-55.html;_ylt=Ahc6x60yB8n8JzvfVztu4QsIJHdG
Labels:
DKIM,
DNS,
hMailserver,
SPAM,
SPF,
Web Applications
URL file-access is disabled in the server configuration
One of my PHP app used to send out SMS alerts using HTTP based SMS Gateway. Everything was working fine till last week when the SMS stopped coming. On running a stand alone PHP page using the same function to send SMS as the page in the application, got this error -
"Warning: fopen(): URL file-access is disabled in the server configuration"
"Warning: fopen(): URL file-access is disabled in the server configuration"
Labels:
disabled,
file-access,
fopem,
PHP,
URL,
Web Applications
PHP 5.3 and MySQL timeouts
On my dev machine, WinXP SP3, I had PHP 5.2 configured with IIS 5.1 and MySQL 5. Recently upgraded to PHP 5.3 and whooops.. most of my applications stop working.. :? first the ISAPI was discontinued so I had to go the FastCGI way but for some reason I just could not make it work. The browser will just offer me to download/ save the file. As I was in a hurry I thought $#@*& IIS, lets try Apache. Installed and configured Apache with PHP and the phpinfo page works fine but pages with MySQL connection will still not load... after wasting sometime trying to figure out what was wrong, went to the doorstep of all knowing Google.. and found this
Subscribe to:
Posts (Atom)