Monthly Archives: January 2012

Beginner Sinhala Lesson 4 – Pronouns

Beginner Sinhala Lesson 4

Pronouns.

Pronouns in Sinhala are divided into four distinct classes according to distance. මේ “me” indicates that the thing or person being referred to is in close proximity to the speaker. ඔ “o” indicates that the thing or person being referred to is in close proximity to the hearer. Infact in modern Sinhala, words such as ඔයා “Oya”, there person near you, are taking to literally mean “you”. අර “ara” indicates that the thing or person is relatively distant to both the speaker and the listener – “over there”. එ “e” refers to a person or thing that was mentioned earlier in the conversation or something that both are already aware of.

මම
mama
I
මගේ
magee
My
මගෙන්
magen
From / by me
මට
mata
to me
මාව
maawa
Me
මෙයා
Meyaa
‘This one’
මෙයාගේ
Meyaagee
‘This one’ ‘s
මෙයාගෙන්
Meyaagen
From/by ‘this one’
මෙයාට
meyaata
to ‘this one’
මෙයාව
Meyaawa
‘This one’ (acc)
 ඔයා
oyaa
You
ඔයාගේ
oyaagee
Your
ඔයාගෙන්
oyaagen
From / by you
ඔයාට
oyaata
To you
ඔයාව
oyaawa
You (acc)
අරයා
arayaa
‘That one there’
අරයාගේ
arayaagee
‘That one there’ ‘s
අරයාගෙන්
arayaagen
From /by ‘that one there’
අරයාට
arayaata
To ‘that one there’
අරයාව
arayaawa
‘That one there’ (acc)
එයා
eyaa
He / She
එයාගේ
eyaagee
His / Her
එයාගෙන්
eyaagen
From / by him / her
එයාට
eyaata
to him / her
එයාව
eyaawa
him / her
අපි
api
We
අපේ
apee
Our
අපෙන්
apen
From / by us
අපිට
apita
To us
අපිව
apiwa
us
ඔයාලා
oyaalaa
You (plural)
ඔයාලගේ
oyalaage
Your (plural)
ඔයාලගෙන්
From / by you (plural)
ඔයාලට
To you (plural)
ඔයාලව
you (acc plural)

The plural affix “ලා” can be added to මෙයා, අරයා and එයා (meyaa, arayaa, eyaa) to make them plural in number.

Examples

ඔයාට පොතක් තියෙනවා
oyaata pothak thiyenawaa
‘You have a book’ (lit. to you a book there is)

මගේ කාර් එක
magee kaar eka
‘My car’

එයාගෙන් අහන්න
eyaagen ahanna
‘Ask from him

අපි එයාව දැක්කා
api eyaawa d@kkaa
We saw him

මෙයාලගේ කෑම
meyalaage k@@ma
These one’s food

Hardware Keylogger

Hardware Keylogger schematic

Cisco Routers – Delay down for backup connections.

Currently in my job I am using a Cisco Series 2900 router.

The Cisco router has a primary connection (which is fibre), a secondary connection (which is ADSL) and a tertiary connection (which is through mobile 3G connection).

We had been noticing that our site-to-site VPN links have been going down – and that some users have been losing some of their work through our ERP system. Upon investigation, the problem seemed to be our fibre link dropping momentarily. Everytime the link was dropping, the backup connection tried to take over and failed due to the site-to-site VPNs not being configured to take the backup link automatically. In fact, there is no way to re-establish a VPN link automatically because VPNs route the traffic according to subnet and only one subnet can be assigned to one tunnel with one endpoint.

Since the link was going down for about 5 seconds (due to saturation and ISP issues) and the client ERP software could only handle a drop out of up to 30 seconds before it would lose all data and users would become angry – I had to find a solution. And I found one!

conf t
track 1 ip sla 1 reachability
delay down 180
track 2 ip sla 1 reachability
delay down 180
[Ctrl Z]
wr

I typed the following into a telnet session to our Cisco router. Apparently the backups have a maximum delay  of 3 minutes (180) of being in a state of “down” (delay down) before it would try the next backup link. This was just what I needed as it would take me around 3 minutes to manually switch over our main site-to-site VPN connection to the backup connections. As the drop outs were occuring for no longer than 5 seconds, the users were not losing valuable data.

track 1 refers to the first backup and track 2 refers to the second backup

After employing a fix, I then began to work with our ISP into making our connection much more reliable – but I was quite happy to find this fix.

Hash Search – In C

#include <stdio.h>
#include <string.h>
#include <malloc.h>

#define MAXLEN 80
#define HASHSIZE 31             // random prime.
#define SHIFTBY 3               // each group size in hashing.

typedef struct node node;
typedef char *type;
typedef node *hashtable[HASHSIZE];

struct node {
   int val;
   char *key;
   node *next;
};

int hGetIndex(char *key) {
   /*
    * returns index into hashtable applying hash function.
    * uses shift-folding followed by mod function for hashing.
    */
   int i, n, finaln=0;
   char *keyptr;

   for(keyptr=key; *keyptr; finaln+=n)
       for(i=0, n=0; i<SHIFTBY && *keyptr; ++i, ++keyptr)
              n = n*10 + *keyptr;
   finaln %= HASHSIZE;

   return finaln;
}

void hInsert(hashtable h, char *key, int val) {
    /*
     * insert s in hashtable h.
     * use shift-folding followed by mod function for hashing.
     * does NOT check for duplicate insertion.
     */
   node *ptr = (node *)malloc(sizeof(node));
   int index = hGetIndex(key);

   ptr->key = strdup(key);
   ptr->val = val;
   ptr->next = h[index];

   h[index] = ptr;
   printf("h[%d] = %s.\n", index, key);
}

int hGetVal(hashtable h, char *key) {
   /*
    * returns val corresponding to key if present in h else −1.
    */
   node *ptr;

   for(ptr=h[hGetIndex(key)]; ptr && strcmp(ptr->key, key); ptr=ptr->next)
      ;
   if(ptr)
       return ptr->val;
   return −1;
}

void printHash(hashtable h) {
    /*
     * print the hashtable rowwise.
     */
   int i;
   node *ptr;

   for(i=0; i<HASHSIZE; ++i) {
       printf("%d: ", i);
       for(ptr=h[i]; ptr; ptr=ptr->next)
              printf("%s=%d ", ptr->key, ptr->val);
       printf("\n");
   }
}

int main() {
    char s[MAXLEN];
    int i = 0;
    hashtable h = {"abc"};

    printf("Enter the string to be hashed: ");
    gets(s);

    while(*s) {
       hInsert(h, s, i++);
       printf("Enter the string to be hashed(enter to end): ");
       gets(s);
    }
    printf("Enter the string to be searched: ");
    gets(s);

    while(*s) {
       printf("%s was inserted at number %d.\n", s, hGetVal(h, s));
       printf("\nEnter the string to be searched(enter to end): ");
       gets(s);
    }
    //printHash(h);

    return 0;
}

Intermediate Sinhala – Lesson 10 – Politics

Intermediate Sinhala – Lesson 10

Dialogue

ගයන්: එන සුමනේ චන්දෙ තියෙන හින්ද විරුද්ද පක්ෂ විසින් විහාරමහාදේවි පාර්ක් එකේ රැළියක් පවත්තනවා. කැම්පස් එකෙන් යාළුවන් සහම්රු ඒකට යනවා එක්සත් ජාතික පක්ෂයට ආධාර දෙන්න. මමයි යන එක ගැන සලකනවා.
රොමේෂ්: අනේ යන්න එපා. දේශපාලනේ නම් වැඩක් නැහැ. කොච්චර ට්‍රයි කලත් මුකුත් වෙනස් වෙන්නේ නැහැ. හොඳ අදහසක් සමග තියෙන ය වත් පක්ෂයකට ඈඳුනාම එයා ආදර්ශ කරන ජනතා ගැන ඉක්මනට අමතක වෙලා තමන්ම ගැන විතරක් හිතා ගන්නවා.
ගයන්: නමුත් මචං. අපේ ජනපති අපේ රටට වැරදි ගොඩක් කරනවා වගේයි. කොහොම හරි අපේ තරහ පෙන්නෙන්න ඔනෑ නේ?
රොමේෂ්: වෙන්න ඇති එත් වෙන පොරා එයාට වැඩ හොඳ නැහැනේ.. ඉතින් මේ චන්දෙ මග අරිනවා. චන්දෙ දෙන එක වත් එපා කරනවා.
ගයන්: කෝ ඉතින් ඔහොම ඉන්න. මම යනවා.
රොමේෂ්: පරිස්සමින් ඉන්න. සමහර වෙලාව රැලිය තදබල වෙන්න පුළුවන්. ගල් වලින් හැපෙයි. පොලිස් කාරයන් උඹලට ගහයි.
ගයන්: මම බලා ගන්නන්. බය ගන්නන්න එපා. මම රැලියේ ඉන්න කොට ඔය මොනවාද කරන්නේ?
රොමේෂ්: අනිද්දා විබාගයක් තියෙනවා. මම ඒකට පොතක් කියවන්න ඔනෑ.
ගයන්: හොඳි. හවසේ හමු වෙමු.
රොමේෂ්: හමු වෙමු.

Gayan: There is a political rally being held in Vihara Maha Devi Park by the Opposition parties because there is the election next week. Some of my friends from University (campus) are going to support the United National Party. I am also considering about going.

Romesh: Oh Please don’t go! Politics is useless. No matter how much (one) tries nothing will change. Even those who are with a good intention, when they join to a party forget soon about the people who they represent and only think about themselves.

Gayan: But buddy! It seems our President is doing a lot of wrong to our country. We must show our anger somehow, isn’t it?

Romesh: It may be, but The other guy is no better than him. I’m avoiding this election. I hate even voting.

Gayan: Ok just be like that then. I’m going

Romesh: Be careful. Sometimes political rallies may become violent. (You) may get hit by stones. The police may beat you.

Gayan: I will take care. Don’t frighten me. While I am at the rally what will you do?

Romesh: Tommorow there is an exam. I am have to read a book for it.

Gayan: Ok. See you in the evening.

Romesh: See you.

Vocabulary

I will add later.

Grammar

I will add later.

Intermediate Sinhala – Lesson 9 – Complex Sentences

Intermediate Sinhala – Lesson 9

Dialogue

අවිනේෂ්: මම ඉස්සෙල්ල ගැලී පාරේ හම්බ වෙච්ච නාමය අමතක කෙරුව ළමයට කතා කරා. ඌ මට කිව්වා එයාගේ ගම ඇති නොදියුණු ඉඩම් ඔක්කොම දැන් ගංවතුරු වලින් යට වෙලා තිඑයනවා ලු
රොෂාන්: ඔව්. ටී වී එකේ ඒක පිළිබඳු ආරංචි දැක්කා. එහෙ නොයෙක් මිනිස්සු ගියා ලු. බොහොම දුකි. ජනපති ගංවතුරු වලින් වැදුණු ඒගොල්ලන්ට පුන්‍යයතනයක් පිහිටෙව්වා.
අවිනේෂ්: හොඳයි. ඉතින් අපි අදට හම්බ කරන සල්ලි දෙමු.
රොෂාන්: ඒක ඔයාට නම් හොඳයි.. මම දැන් වැඩ කරන්නේ නෑනේ.. මොනවා කරන්නද!
අවිනේෂ්: කිසිම ප්‍රශ්නයක් නැහැ මල්ලි. මම ඔය වෙනුවෙන් සල්ලි දෙන්නන්
රොෂාන්: හරි
අම්මා: අවිනේෂ්! ඉක්මනට කන්න ඔයාගේ කෑම! පරක්කු වෙයි. අද වැඩ කරන්නේ නෙද්ද?
අවිනේෂ්: හරි හරි අම්මා. මම ඉක්මනට කන්න බලනවා.
අම්මා: ඔයාගේ කන්තෝරු යන්න කලින් නැන්දගේ ගෙදර ගිහිල්ල එයාට මේ මල් පොකුර දෙන්න. හරි පුතේ!
අවිනේෂ්: හරි අම්මා.. දෙන්නන්

Avinesh: I was talking to the boy whose name I don’t remember which I met earlier on Galle Road. He told me that the undeveloped lands around his village have become flooded.

Roshan: Yes. I saw the news about that on the TV. They said a lot of people died there.(Its) very sad. The president has established a charity for those that are affected by the floods.

Avinesh: Good. so let’s give the money that we earn today .

Roshan: That’s good for you (but) I am not working, am I? What on earth to do!

Avinesh: It’s no problem at all I will give money for you.

Roshan: fine.

Mum: Avinesh! quickly eat your food! It becomes late. (You are) working today aren’t you?

Avinesh: Ok ok mummy. I will try to eat quick.

Mum: Before you go to the office go to (your) Aunt’s place and give this bunch of flowers to her. ok son!

Avinesh: Ok ok mummy. (I will) give.

Vocabulary

I will post later

Grammar:

I will post late

Intermediate Sinhala – Lesson 8 – Very Funny!

Intermediate Sinhala – Lesson 8

Dialogue

චතුර: මොකෝ හිනා වෙන්නේ?
චන්න: ලී කොල්ල මට විහිළුවක් කිව්වා. මෙන්න මම දැන් ඔයාට කියන්නන්.
දවසක පොලිස්කාරයන් දෙදෙනෙක් පෙලියගොඩ පාලමේ යන වාහන හරිද බලන්න හිටිය. හදිසියෙන්ම අලුත් කාර් එකක් ඇවිල්ල පොලිස් කාරයන්ට ඉස්ස‍රට නැවතුවා. කාර් එකේ මහතා  යුරෝපිය මිනිහෙක් හිටියා. එය කතා කරන්න බලපුහම පොලිස් කාරයන් එක්කෙනෙක් security hut එක පිටපස්සට ගියා – හේතුව එයා ඉංග්‍රීස් අඩු වැඩියෙන් දන්නවා. අනිකත් ඉංග්‍රීස් හොඳට දන්නේ නැහැ හැබැයි යම්කිසි දෙනෙක් පරදෙශියත් එක්ක කතා කරන්න තියෙන නිසා එයට පල යන්න බැරි උනා. පරදෙශියා ඉන්ග්රිසෙන් ඇහුවා “මේ පාර මොකක්ද? කොහොමද කුරුඳු වත්ත යන්නේ?” කියලා. පොලිස් කාරයා පාර හොඳට දන්නවා එත් ඉංග්‍රීස් වලින් විස්තර කියන්න බැරි නිසා නිස්සබ්දෙන් උනා. පරදෙශියා ෆ්‍රෙන්ච් වලින් එකම ප්‍රශ්නේ ඇහුවා හැබැයි පොලිස් කාරයා මුකුත් කිව්වේ නැහැ. පරදෙශියා ජෙර්මන් වලින් ආයෙම ඇහුවා. එකම විපාකයයි. පරදෙශියා තව භාෂා හතරකින් ඇහුවා එත් පොලිස් කාරයා උත්තුරුවක් දුන්නේ නැහැ. ඒ නිසා එයා ගියා. security hut එක අග හිටිය පොලිස් කාරයා ඒ ඔක්කොම අහලා ඉස්සහරට ගිහින් කිව්වා “මචං අපි සිංහල වලට අමතරව වෙන එක බශාවක් වත් දැන ගෙන හිටියානම් අද කොච්චර ප්‍රයෝජනයක්ද?” කියලා. ඒකට අනිත් පොලිස් කාරයා කිව්වා “අනේ නිකන් හිටපන් බං! සුද්ධා කොච්චර භාෂා දැන ගෙන හිටියාද? කෝ ඌට වැඩක් උනාද?” කියලා.
හක් හක්.
චතුර: හා හා බොහොම විහිළුයි!

Chathura: Why are you laughing?

Channa: Lee told a joke. Here ,I will now tell it to you.

One day there was two policemen checking vehicles that were going on Peliyagoda Bridge. Suddenly a new car came and stopped in front of the policemen. In the car was a fat European (man). As soon as he was about to speak one of the policemen went to the back of the security hut – Because he knew too little English. The other one did not know English well either but because someone was supposed to talk to the Foreigner he couldn’t escape. The foreigner asked in English “What was this road and how to get to Cinnamon  Gardens. The policeman knew the road well but, because (he) couldn’t describe in English, became quiet. The foreigner asked the same question in French, but the Policeman said nothing. He asked again in German. Same result. The foreigner asked in four other languages but the Policeman said nothing. So he went (away). The policeman who was at the end of the security hut heard all of it, came to the front and said “Buddy in addition to Sinhala if we even knew one other language how useful would it be?”. The other policeman said to that “Oh please just stop! The whitey knew how many languages? Was that any use to him?”

He he!

Chathura: Ha ha.. Very funny!

Vocabulary

I will write later

Grammar

I will write later

Intermediate Sinhala Lesson 7 – Time phrases II

Intermediate Sinhala Lesson 7

Dialogue

ලී: චතුර.. ඇයි ඔච්චර තෙමිලා?
චතුර: දැන් වහිනවා නේ ගෙම්බා! මම බස් එකෙන් යන ගමං හොඳටම වහින්න ගත්තා.
ලී: මම මාලබේට අවපු ගමං වහින්න ගත්ත නිසා රික්ෂව් කෙනෙකුට අමතලා රික්ෂව් එකකෙන් මෙහෙ අවා. වහින කොට පාර දිගේ පයින් යන්න අමාරුයි.
චතුර: මම නාපුහම කැරොම් ගහමුද? දැන් ලයිට් ගිහිල්ලා වගේයි.සජී එන්නවද නෙද්ද කියලා උඹට කිව්වාද?
ලී: සජී මට මුකුත් කිව්වේ නැහැ. එයා හවසේ එනවා වෙන්න පුළුවන්. මට ගොඩක් බඩගිනියි.. හැබැයි මෙහෙ කන්න කෑමක් නැහැ. මේ වැස්ස නිසා පිට යන්න කම්මැලියි.
චතුර: තෙමිච්ච මගේ ඇඳුම් දාන්නේ කොහෙද? උඹටත් මට ශවුර්ට් පැන්ට් එකක් දෙන්න පුළුවන්ද?
ලී: දෙන්නං දෙන්නං. ඔයාගේ ඇඳුම් ඔක්කොම මෙහේ දැම්මොත් මම ඒවා අරන් වේලෙන්න රෙදි වැලේ  එල්ලා තබන්නං

Lee: Chathura… Why are you so wet?

Chathura: It is raining now, isn’t it (you) frog! While I was going from the bus it started to rain heavily.

Lee: I called a rickshaw driver and came by rickshaw because it started to rain as soon as I came to Malabe.It is difficult to walk along the road when it is raining.

Chathura: As soon as I bath, shall we play Carrom? It seems the power has gone out. Did Saji tell you whether (he) was coming or not?

Lee: Saji didn’t tell me anything. He will probably come in the evening. I am a lot hungry! but there is no food to eat here. I can’t be bothered to go out because of the rain.

Chathura: Is there anywhere (lit: Where to) put my wet clothes? (lit: my clothes which became wet). Can you give me some shorts too?

Lee: (I) will give, (I) will give. If you put all your clothes here I will take them and hang (them) on the clothes line to dry.

Vocabulary

I will update later.

Grammar

I will update later.

Intermediate Sinhala – Lesson 6

Intermediate Sinhala – Lesson 6

Dialogue

බණ්ඩාර: බී ඇන්ඩ් එස් ගේ අලුත්ම සින්දුව අහලාද තියෙන්නේ?
චාමර: අහලා නැහැ. මම එ බෑන්ඩ් එකට එච්චර කැමති නැහැ.
බණ්ඩාර: ඒ මොකද?
චාමර: මොකද එයාලා ගයන විදහා විනෝදක් නැත්තේ එකයි.
බණ්ඩාර: කමක් නැහැ. අද කරන්න මොනවටද කැමති?
චරම: අද මම ශාර්ට් එකක් ගන්න කැමති. මොකද හෙට මම අලුත් රැකියාවක් ආරම්බ කරනවා නේ.
බණ්ඩාර: කොහෙද වැඩ කරන්නේ?
චාමර: කොල්ලුපිටිය. මම බැංකුවේ වැඩ කරනවා
බණ්ඩාර: රස්සාව මොකද්ද?
චාමර: මම බැංක ලිපිකරුවෙක් හැටියට වැඩ කරන්න යනවා.
බණ්ඩාර: ශා! නියමයි පඩිය කීයද?
චාමර: මසයකුට රුපියල් 2500ක් තියේ
බණ්ඩාර: එල! එකට ඊළඟ සති අග අපි පාර්ටි එකක් දාමු.
චාමර: අනිවා! මම වැඩ කරන කොට මට ලැබෙච්ච මේ අවස්ථාව විනෝද කරන හොඳම හැටිය ගැන හිතන්නන්.
බණ්ඩාර: එල.

Bandara: Have you B’n’S’s latest song?

Chamara: I haven’t heard (it). I don’t like that band so much.

Bandara: Why’s that?

Chamara: I don’t enjoy the way they sing.

Bandara: Doesn’t matter. What do you like to do today?

Chamara: I like to buy a shirt. Because I am starting a new job tommorow, aren’t I?

Bandara: Where are you working?

Chamara: Kollupitiya. I am working in the bank (there).

Bandara: What role?

Chamara: I am going to work as a bank clerk?

Bandara: Cool! Excellent. How much is the wage?

Chamara: It will be 2500/= a month.

Bandara: Sweet! next week end lets hold a party for it!

Chamara: Sure! While I am working in the office I will think about the best way to celebrate this occasion that has come my way.

Bandara: Sweet!

Vocabulary

I’ll write here later.

Grammar

I’ll write here later.

Beginner Tamil – Lesson 1

Noun Classes – Tamil

The ending of Tamil nouns determines what class they fall into.

No Tamil noun ends in a stop consonant (க், த், ச், ப், ட்)

Tamil nouns ending in இ, ஐ, ஈ will form class 1.

Tamil nouns ending in அ, ஆ, ஒ, ஓ, ஊ will form class 2.

Tamil nouns ending in உ (but not டு or  று) will form class 3

Tamil nouns ending in டு or  று will form class 4

Tamil nouns ending in அம் will form class 5.

Tamil nouns have a noun-case system which we will list below:

Tamil Case Function Example
object  என்னை (me)
ஆலெ instrument கண்ணாலெ  (by the eye)
(உ)க்கு dative கடைக்கு (to the shop)
ஓட Possessive /Sociative உன்னோட (your / with you)
இலெ Inanimate Locative வீட்டிலெ (in the house)
இலெருந்து Inanimate Ablative ஊரிலெருந்து (from the village)
கிட்டெ Animate Locative என்கிட்டெ (in me)
கிட்டெருந்து Animate Ablative  தங்கச்சிகிட்டெருந்து( from younger sister)

Still working on this.