தென்னாடுடைய சிவனே போற்றி எந்நாட்டவர்க்கும் இறைவா போற்றி
ஆனால் இங்கே மாணிக்கவாசகரோ எந்நாட்டவர்க்கும் இறைவா என்றுக் கூறினாலும், இறைவனை தென்னாடுடையவன் என்று சிறப்பாகக் கூறுகின்றார். அவரின் இந்தக் கூற்று சரியான ஒன்றா?

மாணிக்கவாசகர் தமிழகத்தை சேர்ந்தவர்… அதனால் அவர் ’தென்னாடுடைய சிவனே’ என்று கூறி இருக்கின்றார்… இதுவே ஒரு வடநாட்டினைச் சேர்ந்த ஒருவர் எழுதி இருந்தால் அவர் ‘வடநாட்டினை உடைய சிவனே” என்று தான் கூறி இருப்பார். அப்படி என்றால் இறைவன் வடநாட்டினை மட்டும் சேர்ந்தவர் ஆகி விடுவாரா?… இறைவன் முழு உலகத்திற்கும் உடையவர்” என்றுக் எண்ணுகிறீர்களா

ஒருக் கருத்து உண்மையான கருத்து ஆக வேண்டும் என்றால் அது எல்லா நிலையிலிலும் நிலைத்து நிற்க வேண்டும்.எல்லா நிலைக்கும் பொருந்த வேண்டும். இப்பொழுது ‘தென்னாடுடைய’ என்னும் சொல் ‘தெற்குத் திசையில் உள்ள ஒரு நாட்டினைக்’ குறிப்பதாக இருந்தால் அந்த நாடு இடத்திற்கு இடம் மாறுபடுவதாக அமைந்து விடும்.

சீனத்திற்கு தென்னாடு வடஇந்தியா.

வடஇந்தியாவிற்கு தென்னாடு தமிழகம்.

தமிழகத்திற்கு தென்னாடு ஆப்பிரிக்கா.

இப்படியே அந்தக் கருத்து அர்த்தமில்லாத ஒருக் கருத்து ஆகி விடும். எனவே மாணிக்கவாசகர் அந்த அர்த்தத்தினில் ’தென்னாடுடைய’ என்னும் சொல்லினை பயன் படுத்தவில்லை.

மாணிக்கவாசகர் ’தென்னாடுடைய’ என்னும் சொல்லினை ‘தென்னவனின் நாட்டினைச் சிறப்பாக உடைய’ என்னும் அர்த்தத்தினில் பயன் படுத்தி இருக்கின்றார்.

‘தென்னவனின் நாடா???”

சற்று விளக்கமாகப் பார்ப்போம்.

தென்னவன் என்றச் சொல் பாண்டியனைக் குறிக்கும். பாண்டியன் என்பதின் அர்த்தம் ‘பழைய நாட்டினை ஆண்ட மன்னன்’ என்பதே ஆகும். ‘பாண்டி’ என்றால் ‘பழைய’ என்றும் தமிழில் அர்த்தம் இருக்கின்றது.

எனவே ‘தென்னாடு’ என்றால் ‘பாண்டியனால் ஆளப்பட்ட பழைய நாடே ஆகும்’. சிவன் அந்த நாட்டினில் சிறப்பாக இருக்கின்றார் என்றே மாணிக்கவாசகர் கூறுகின்றார்.

“பழைய நாடா ?” – பாண்டியன் மதுரையை அல்லவா ஆண்டான் என்று கூறுபவர்களுக்கு, இப்பொழுது இருக்கும் மதுரை மூன்றாவது மதுரை. இதற்கு முன்னர் இருந்த இரு மதுரைகள் கடற்கோள்களினால் அழிந்துப் போயின. அது வரலாறு!!! குமரிக்கண்ட வரலாறு!!! மாணிக்கவாசகர் ‘தென்னாடு’ என்றுக் குறிப்பிடுவதும் இந்த குமரிக்கண்டத்தையேதான்.

Telephone Etiquette

While Speaking in telephone

  1. You should get acknowledged after telling something
    e.g.
    Shall I Continue
    Am I Clear
    Any Queries
    Are you clear
  2. Instead of telling everything in single stretch chunk your data by using the above keywords.
  3. Try to monitor your client speed of speaking. Try to mirror you client speed of speaking.
  4. Speak Politely

You have to send the mail today
Could you send the mail today

When ever you pick the call
Hi Laura
This is Mugil from Infonovum
Is this a good time to speak to you for 2 Minutes

Leaving Voice Message
You should Tell your name and where you are calling from

Group Discussion Etiquette

  1. In group discussion you should be a active listener.Look at the person who is speaking rather than looking up and down.
  2. If A gives the point, B starts speaking on point given by A while responding to A’s point B should look at every one C,D,E.In other words while responding to someone to someones point look at everyone and speak rather than responding to single person.

Styles of Communication
Submissive
Low Levels of confidence, Feeling guilt, Avoiding Initiative, Suppressing emotions

Assertive
Clear about what you feel need and how to achieve it, confident, and open to other ideas. Open body language, give and receive +ve and -ve feedback

Aggressive
Insulating people, Loosing temper, attacking others

Other Common Mistakes in GD
I Have conflict with you – Wrong
I don’t agree with you – Right

Feedback Etiquette

  1. Avoid using you.Pointing fingers to particular person for failure.Start using we as a Team failed
  2. While we were discussing requirements instead of you were telling requirements
  3. We as a Team failed rather than you has failed.

Commonly Made Mistakes in English

I have Eaten (Just Happened)

Wrong – The Car Parking is Opposite to Garden
Right – The Car Parking is Opposite Garden

Ball Park Figure – Approximate Figure

Rain Check – Asking for a Postponement
eg Can I ask for a Rain Check

Out of the woods – Out of Danger.
eg The Project is Out of Woods

In the Loop
eg Keep me in the Loop while mailing the Clients

Rub Shoulders with
eg We need to rub shoulders with our clients to better understand the project

put it in back burner
eg Let us put this thing in back burner until we are done with the Development.

Cutlery Etiquette

67f6973c3c1383f2c40ad47918713b59

“Words are, of course, the most powerful drug used by mankind.”

[gdoc key=”https://docs.google.com/spreadsheets/d/1VVLzz-2mtNNv4bHV1wMTjixmmbU4NY8FeDp_LAOL3Q8/edit?usp=sharing”]

String Questions

  1. How to find the Longest Substring in String
  2. Swapping Letters in 2 Words
  3. Print String in Reverse Order
  4. Print Left Right Angle Triangle
  5. Inverted Right Triangle
  6. Print Right Angle Triangle
  7. Print Pyramid
  8. Sum of Pairs in Array of Numbers
  9. Check 2nd List has all elements in 1st List
  10. How to find String is anagram
  11. Check Palindrome
  12. Reverse of String without for loop and array
  13. Check Palindrome with recursion

1.How to find the Longest Substring in String
Input

String strSample = "ABCAAABCD"

Output

ABCD
public static void main(String[] args) 
{
   String Test = "ABCAAABCD";
   String dummy = ""; 
		
   String[] arrTest = Test.split("");
		
   List<String> seenChars = new ArrayList<String>();
   List<String> subStrings = new ArrayList<String>();
		
   int j = 0;
		
   for (int i = 1; i < arrTest.length; i++) 
   {
      if(seenChars.contains(arrTest[i]))
      {
	 subStrings.add(dummy);
	 dummy = "";
	 seenChars.clear();
      }
			
      seenChars.add(arrTest[i]);
      dummy += arrTest[i];
			
       j = i + 1;
			
       if(j == arrTest.length)
	  subStrings.add(dummy);
   }
		
   int highestNo = 0;
   int lastHighest = 0;
   int currHighestNo = 0;
   int highestPOS = 0;
	
   for(int k = 0; k < subStrings.size() ; k++)
   {
	currHighestNo = subStrings.get(k).length();
		
	if(currHighestNo  > lastHighest)
	{
  	  highestNo = currHighestNo;
	  highestPOS = k;
	}		
	  lastHighest = currHighestNo;
	}
		
	System.out.println(subStrings.get(highestPOS));		
}

Method 2

public static void main(String args[]) 
{
	String Test = "ABCDEAAABCDA";
	String dummy = "";

	String[] arrTest = Test.split("");
	String longestSubString = "";

	List<String> seenChars  = new ArrayList<String>();
	List<String> subStrings = new ArrayList<String>();

	for (String strTest : arrTest) 
	{
		if (seenChars.contains(strTest)) 
		{
			if (dummy.length() > longestSubString.length())
				longestSubString = dummy;

			subStrings.add(dummy);
			dummy = "";
			seenChars.clear();
		}
		
		seenChars.add(strTest);
		dummy += strTest;
	}
	
	if (dummy.length() > longestSubString.length())
	{
		longestSubString = dummy;		
		subStrings.add(dummy);	
	}
	 
	System.out.println("Longest subString is: " + "'" + longestSubString + "'" + " and length is: "
			+ longestSubString.length());
}

2.Swapping Letters in 2 Words
Input

MUGIL XXX

Output

MXUXGXIL
public class Array1 
{
 static List arrNewList1 = new ArrayList();
 
 public static void main(String[] args) 
 { 
   String text1 = "MUGIL";
   String text2 = "XXX"; 
 
   String[] arrList1 = text1.split("");
   String[] arrList2 = text2.split("");
 
   if(arrList2.length > arrList1.length)
    swapArrays(arrList2, arrList1);
   else 
    swapArrays(arrList1, arrList2);

 
 
   StringBuilder strBr = new StringBuilder();
 
   for (int i = 0; i < arrNewList1.size(); i++) 
    strBr.append(arrNewList1.get(i));
 
    System.out.println(strBr); 
 }
 
 public static void swapArrays(String[] pBigList, String[] pSmallList)
 { 
   for (int i = 0; i < pBigList.length; i++) 
   { 
     arrNewList1.add(pBigList[i]);
 
     if(i < pSmallList.length)
      arrNewList1.add(pSmallList[i]);
   }
 }
}

Note

 .
 .
 String Text1 = "M,U,G,I,L";
 String Text2 = "MUGIL";
		
 System.out.println(Text1.split(",").length);
 System.out.println(Text2.split("").length);
 .
 .

Output

5
6

you may be puzzled why first prints 5 and second prints 6.Thats because the empty space between “M is taken as 1 element in Text2

3.Print String in Reverse Order
Input

asanam

Output

asanam
package com.mugil.test;

public class ReverseString {

 public static void main(String[] args) {
  String strName = "manasa";

  //char[] arrNames = strName.toCharArray();

  String[] arrNames = strName.split("");

  for (int i = arrNames.length - 1; i >= 0; i--) {
   System.out.print(arrNames[i]);
  }
 }
}

4.Print Left Right Angle Triangle
Input

Total number of Rows - 5

Output

* 
** 
*** 
**** 
***** 
package com.mugil.test;

public class Patterns2 {
 public static void main(String[] args) {
  int rows = 5;

  for (int i = 1; i <= rows; i++) {
   for (int j = 1; j <= i; j++) {
    System.out.print("*");
   }

   System.out.println(" ");
  }
 }
}

5.Inverted Right Triangle
Input

Total number of Rows - 5

Output

***** 
**** 
*** 
** 
*  
.
int rows = 5;

for (int i = rows; i >= 0; i--) {
 for (int j = 1; j <= i; j++)
  System.out.print("*");

 System.out.println(" ");
}
.

6.Print Right Angle Triangle
Input

Total number of Rows - 5

Output

     * 
    ** 
   *** 
  **** 
 *****  
int n = 5;
int j = 0;
int k = 0;

for (int i = 0; i < n; i++) {
 for (j = n - i; j > 1; j--)
  System.out.print(" ");

 for (j = 0; j <= i; j++)
  System.out.print("*");

 System.out.println();

}

7.Print Pyramid
Input

Total number of Rows - 5

Output

    * 
   * * 
  * * * 
 * * * * 
* * * * *  
int n = 5;
int j = 0;
int k = 0;

for (int i = 0; i < n; i++) 
{
 for (j = n - i; j > 1; j--)
  System.out.print(" ");

 for (j = 0; j <= i; j++)
  System.out.print("* ");

 System.out.println();

}

The only Difference between Right Angle Triangle and Pyramid is Space in *

8.Sum of Number Pairs in Array
Input

Array of Numbers - {0,1,2,2,3,4}
Sum - 4

Output

(0,4)
(1,3)
(2,2)
.
Integer[] arrNumbers = { 0, 1, 2, 2, 3, 4, 5};
int sum = 4;

for (int i = 0; i < arrNumbers.length; i++) {
 for (int j = i + 1; j < arrNumbers.length; j++) {
  if (arrNumbers[i] + arrNumbers[j] == sum) {
   System.out.println("(" + arrNumbers[i] + "," + arrNumbers[j] + ")");
  }
 }
}
.

9.Check 2nd List has all elements in 1st List
Input

2 List of Elements
{1,2,3,4}{2,3}
{1,2,3,4}{2,5}
{2,3}{2,5,6}  
{2,3}{2,3,9}  

Output

{1,2,3,4}{2,3}  -> true
{1,2,3,4}{2,5}  -> false
{2,3}{2,5,6}    -> false
{2,3}{2,3,9}    -> false
public boolean checkEquals()
{
  Integer orig[] = {1,2,3,4};
  Integer act[] = {2,3};
           
  List origList = new ArrayList(Arrays.asList(orig));
  List actList = Arrays.asList(act);
   
  origList.retainAll(actList);
  System.out.println(origList);
      
  if(actList.size()==origList.size())   
    return true;
  else
    return false; 
}

10.How to find String is anagram?
Output

Keep and Peek are anagrams
silent and listen are anagrams
MotherInLaw and HitlerWoman are anagrams
public class AnagramString 
{
 static void isAnagram(String str1, String str2) 
 {
  String s1 = str1.replaceAll("\\s", "");
  String s2 = str2.replaceAll("\\s", "");
  boolean status = true;

  if (s1.length() != s2.length()) 
   status = false;
  else 
  {
   char[] ArrayS1 = s1.toLowerCase().toCharArray();
   char[] ArrayS2 = s2.toLowerCase().toCharArray();
   Arrays.sort(ArrayS1);
   Arrays.sort(ArrayS2);
   status = Arrays.equals(ArrayS1, ArrayS2);
  }

  if (status)
   System.out.println(s1 + " and " + s2 + " are anagrams");
  else
   System.out.println(s1 + " and " + s2 + " are not anagrams");  
 }

 public static void main(String[] args) 
 {
  isAnagram("Keep", "Peek");
  isAnagram("silent", "listen");
  isAnagram("Mother In Law", "Hitler Woman");
 }
}

11.Check Palindrome
Input

malayalam

Output

Entered string is a palindrome
 public static void main(String args[])
 {
      String original, reverse = "";
      original = "madam";
 
      int length = original.length();
 
      for ( int i = length - 1; i >= 0; i-- )
         reverse = reverse + original.charAt(i);
 
      if (original.equals(reverse))
         System.out.println("Entered string is a palindrome.");
      else
         System.out.println("Entered string is not a palindrome."); 
  }

12.Reverse of String without for loop and array
Input

mugil

Output

ligum
static String reverseMe(String s) 
{
   if(s.length() <= 1)
     return s;

   return s.charAt(s.length() - 1) + reverseMe(s.substring(0,s.length()-1));
 }

13.Check palindrome using recursion
Input

malayalam

Output

palindrome

Call the above reverse function and check with string equals method

public static boolean isPalindrome(String input) 
{
 if (input == null)
  return false;

 String reversed = reverse(input);
 return input.equals(reversed);
}

public static String reverse(String str) 
{ 
 if (str == null) 
  return null;
 
 if (str.length() <= 1) 
  return str;
 
 return reverse(str.substring(1)) + str.charAt(0);
}

What is the simplest SQL Query to find the second largest value?

SELECT MAX(col)
  FROM table
 WHERE col < (SELECT MAX(col)
                FROM table)
SELECT MAX(col) 
  FROM table 
 WHERE col NOT IN (SELECT MAX(col) FROM table);
Posted in SQL.

length – arrays (int[], double[], String[]) —- to know the length of the arrays.

length() – String related Object (String, StringBuilder etc)to know the length of the String

size()– Collection Object (ArrayList, Set etc)to know the size of the Collection

length is not a method, so it completely makes sense that it will not work on objects. Its only works on arrays.

Points to Note

  1. ArrayList allows NULL values many times
  2. Set and HashMap allows NULL once
  3. In HashMap the values will be overwritten when keys are same

List An ordered collection (also known as a sequence). The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list.

MapAn object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value.

Test.java

public class Test
{
 public static void main(String[] args) 
 {
 List<String> arrNames = new ArrayList<String>();
 
 arrNames.add("Hello");
 arrNames.add(null);
 arrNames.add(null);
 arrNames.add("Hi"); 
 System.out.println("List - "+arrNames.size());
 
 Map hmTest = new HashMap();
 hmTest.put("1", "mugil");
 hmTest.put(null, null);
 hmTest.put(null, null);
 hmTest.put("1", "vannan");
 System.out.println("HashMap - "+ hmTest.size());
 
 Set<Integer> setTest = new HashSet<Integer>();
 
 setTest.add(new Integer("10"));
 setTest.add(new Integer("20"));
 setTest.add(new Integer("10"));
 
 System.out.println("Set - "+ setTest.size());
 }
}

Output

List - 4
HashMap - 2
Set - 2

Testing Output using assertEquals
Scenario1.java

public class Scenario
{	
  public int Square(int no)
  {
    return no*no;
  }
}

SquareTest.java

public class SquareTest 
{
  @Test
  public void test() 
  {
    int SquareNo = new Test1().Square(5);		
    assertEquals(25, SquareNo);
  }
}

Scenario2.java(word Counter)

public class Scenario2 
{	
 public int repeatedWords(String pWord)
 {
   int count = 0;
	
   for (int j = 0; j < pWord.length(); j++) 
   {
     if(pWord.charAt(j) == 'a')
     {
       count++;	
     }
   }	
    return count;
 }
}

RepeatTest.java

public class RepeatTest {
   @Test
   public void test() {
     Scenario2 objScenario2 = new Scenario2();		
     assertEquals(objScenario2.repeatedWords("alphabet"), 2);		
   }
}

Test suite is used to bundle a few unit test cases and run them together. In JUnit, both @RunWith and @SuiteClasses annotations are used to run the suite tests.

AllTests.java (TestSuite)

@RunWith(Suite.class)
@SuiteClasses({ RepeatTest.class, SquareTest.class })
public class AllTests {

}

Now Lets take a Real Life Scenario of Bank Account
Account.java

public class Account 
{
	public int Balance;
	
	public Account()
	{
		Balance = 0;
	}
	
	public int getAccBalance()
	{
		return Balance;
	}
	
	public void getCash(int pCash)
	{
		Balance = Balance - pCash;
	}
	
	public void putCash(int pCash)
	{
		Balance = Balance + pCash;
	}
}

BankTest.java

public class BankTest 
{
	Account objAcc = new Account();
	
	@Test
	public void checkAccBalanceTest()
	{
		assertEquals(objAcc.getAccBalance(), 0);
	}
	
	@Test
	public void checkBalAfterDepositTest()
	{
		objAcc.putCash(50);
		assertEquals(objAcc.getAccBalance(), 50);
	}
	
	@Test
	public void checkBalAfterWithdrawTest()
	{
		objAcc.getCash(30);		
		assertEquals(objAcc.getAccBalance(), 20);
	}
}

Points to Note

  1. The methods in BankTest ends with Test Suffix.This ensures the test cases are executed in order.
  2. The Account.java and BankTest.java are two different projects.In BankTest project the other project is added in Java Build Path

If I write something like this

 System.out.println(19);

Which type has the ’19’? Is it int or byte? Or doesn’t it have a type yet?
This 19 is known as an integer literal. There are all sorts of literals, floating point, String, character, etc.

What is integer literal
Integer data types consist of the following primitive data types: int,long, byte, and short.byte, int, long, and short can be expressed in decimal(base
10), hexadecimal(base 16) or octal(base 8) number systems as well.
Prefix 0 is used to indicate octal and prefix 0x indicates hexadecimal when using these number systems for literals.

Examples:

int decimal = 100;
int octal = 0144;
int hexa =  0x64;

Literal means any number,Text or Other information that represents a value.

Different Values that can be assigned to Integer Variable (Integer data type Literal) are

  1. Decimal Literals
  2. Octal Literals
  3. Hexadecimal Literals
  4. Binary Literals
  5. Long Literals
  6. Values with Underscore in Between