Thursday, February 28, 2008

How to find the difference between two times using ANSI C
Here I have attached the C code, which gives some idea about taking difference between two given times. Final result is giving as Years. You can change the values which given inside the parenthesis - (60*60*24*365)

#include <time.h>
#include <stdio.h>

int main(void)
{
struct tm t,tt;
time_t t_of_day,tt_of_day;
double dif;

t.tm_year = 2009-1900;
t.tm_mon = 0;
t.tm_mday = 3;
t.tm_hour = 0; /* hour, min, sec don't matter */
t.tm_min = 0; /* as long as they don't cause a */
t.tm_sec = 1; /* new day to occur */
t.tm_isdst = 0;

tt.tm_year = 2007-1900;
tt.tm_mon = 0;
tt.tm_mday = 3;
tt.tm_hour = 0; /* hour, min, sec don't matter */
tt.tm_min = 0; /* as long as they don't cause a */
tt.tm_sec = 1; /* new day to occur */
tt.tm_isdst = 0;

t_of_day = mktime(&t);
tt_of_day = mktime(&tt);
dif = difftime (t_of_day,tt_of_day);
// You can change the outcome by changing following line
dif = dif /(60*60*24*365);
printf("Time Difference between %s and %s is %.2lf \n",ctime(&t_of_day),ctime(&tt_of_day),dif);

return 0;
}

Tuesday, February 12, 2008

Firefox Sinhala Dictionary Plugin


Do you have ever seen this before in your computer life?? this is not a joke. Colombo university students has been done it.
Following features are available:
  • Simplicity:
    • Translate English words just hovered by mouse.
    • Translate selected words.
  • Automatically de-inflects verbs and adjectives.
  • Replaces translated words choosing one from its translation.
  • Pronounces English words. (Pronunciation of English words requires the installation of Real Player, and ability to run JavaScript.)
This extension is licensed under GNU General Public License v2.

visit: http://www.ucsc.cmb.ac.lk/ltrl/projects/EnSiTip/

As a help for developed guys if you can please put a review on following URL.
https://addons.mozilla.org/en-US/firefox/addon/6422

Tuesday, February 05, 2008

How to Connecting to Google Talk using Kopete

First install QCA-TLS plugin for SSL support
If your using debian or ubuntu run following command as root or supper user.
apt-get install qca-tls
* In kopete go to settings -> Confiure Kopete and click on New from Accounts tab

* Click on next on the introduction screen and choose Jabber from the next screen

* Enter the following information on Basic Setup tab:
-- In the Jabber ID enter: USERNAME@gmail.com
-- Check Remember password and enter your password

* And these information on Connection tab:
-- Check Use protocol encryption (SSL), Allow plain-text password authentication and Overide default server information
-- In the server field enter: talk.google.com and 5223 for the port