Sowji's Blog

It's beautiful life
posts - 8, comments - 8, trackbacks - 0

My Links

Archives

Post Categories

Advertisements at BlogUnlimited.com

Monday, November 28, 2011

C# Concepts

The best example for ref usage is given below for swapping to strings. "ref" object mainly used to do deal with In and out parameters. In the example given below, by passing only two parameters you can see the swapped variables (Two output variables).

Multiple Interface Inheritance and the Abstract class Inheritance is also implemented to know the syntax how it should be declared.

Soon I will be addig some more explanation for below example.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyTest
{
    class SwappingStrings
    {
        static void SwapStrings(out string so1, out string so2, string s1, string s2)
        // The string parameter is passed by reference.
        // Any changes on parameters will affect the original variables.
        {
            string temp = s1;
            s1 = s2;
            s2 = temp;
            so1 = s1;
            so2 = s2;
            System.Console.WriteLine("Inside the method: {0} {1} {2} {3}", s1, s2, so1, so2);
        }
        static void Main(string[] args)
        {
            string str1 = "John";
            string str2 = "Smith";
            System.Console.WriteLine("Inside Main, before swapping: {0} {1}", str1, str2);

            SwapStrings(out str1, out str2, str1, str2);   // Passing strings by reference
            System.Console.WriteLine("Inside Main, after swapping: {0} {1}", str1, str2);
            Console.ReadLine();


            ITest1 t = new MultipleInterFaceClass();
            MultipleInterFaceClass t2 = t as MultipleInterFaceClass;
            ITest t3 = t2 as ITest;
            int a = 9;

            System.Console.WriteLine("Interface Inheritance output: {0} {1}", t3.AddDouble(a, a).ToString(), t.AddDouble(a, a).ToString());
            Console.ReadLine();


            AIICllass sub = new AIICllass();
            Atest baseClass = sub as Atest;
            System.Console.WriteLine(("Abstract Inheritance output: {0} {1}", sub.Concat1("2", "3").Tostring() , baseClass.Concat1("4","5")).Tostring();
            Console.ReadLine();
        }
    }

    public abstract class Atest
    {
        public abstract int Add(int a, int b);
        public abstract double AddDouble(double a, double b);

        public virtual string Concat(string a, string b)
        {
            return a + b;
        }

        internal string Concat1(string a, string b)
        {
            return a + b;
        }
    }

    public interface ITest
    {
        int Add(int a, int b);
        double AddDouble(double a, double b);
    }

    public interface ITest1
    {
        int AddInt(int a, int b);
        double AddDouble(double a, double b);    
    }

    public class Test : Atest
    {
        public override int Add(int a, int b)
        {
            // write appropriate implementation here or:  
            throw new NotImplementedException();
            // or possibly NotSupportedException() if the operation should can't ever be supported
        }
        public override double AddDouble(double a, double b)
        {
            // write appropriate implementation here or:  
            throw new NotImplementedException();
            // or possibly NotSupportedException() if the operation should can't ever be supported
        }

        public override string Concat(string a, string b)
        {
            return a + b;
        }
    }


    public class MultipleInterFaceClass : ITest, ITest1
    {

        #region ITest Members

        int ITest.Add(int a, int b)
        {
            return 2;
        }

        double ITest.AddDouble(double a, double b)
        {
            return 3;
        }

        #endregion

        #region ITest1 Members

        int ITest1.AddInt(int a, int b)
        {
            return 4;
        }

        double ITest1.AddDouble(double a, double b)
        {
            return 5;
        }

        #endregion
    }

    public class AIICllass : Atest, ITest, ITest1
    {
        public override int Add(int a, int b)
        {
            throw new NotImplementedException();
        }

        public override double AddDouble(double a, double b)
        {
            throw new NotImplementedException();
        }

        public string Concat1(string a, string b)
        {
            return a + b + 1;
        }

        #region ITest1

        int ITest1.AddInt(int a, int b)
        {
            throw new NotImplementedException();
        }

        double ITest1.AddDouble(double a, double b)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region ITest Members

        int ITest.Add(int a, int b)
        {
            throw new NotImplementedException();
        }

        double ITest.AddDouble(double a, double b)
        {
            throw new NotImplementedException();
        }

        #endregion
    }

}

 

 Output :

 

Inside Main, before swapping: John Smith
Inside the method: Smith John Smith John
Inside Main, after swapping: Smith John

Interface Inheritance output: 3 5

Abstract Inheritance output : 231 45
 

posted @ Monday, November 28, 2011 5:22 PM | Feedback (1) |

Monday, November 7, 2011

SDET

Below URL's are useful for users who likes to appear for SDET position.:
 
 
  1. Write a queue class with two dequeue methods: one to remove the oldest element and one to remove the max element. Write test cases. Not too bad of a question; definitely a good one to start my day with.
  2. Given a stack class, implement a queue class. Write test cases. Also not too bad; simple stacks and queues. It was an odd question to me though since it’s wildly inefficient, but I gave the answer he wanted.
  3. Given a set of data ranges (i.e. 2-7, 5-9, 10-20), write a function to determine if there is any overlap within the set. Write test cases. This was the hardest one of the day for me. I had to determine which data structure was best for the task which wasn’t clear right away, and I missed some crucial test cases. However, my interviewer seemed relatively pleased with my solution.
  4. Given a string, determine which character appears the most and the number of times that character appeared. Write test cases. This one was a cake walk because I had studied this problem in the days prior to the interview. The solution is outlined in the book Programming Interviews Exposed: Secrets to Landing Your Next Job. I recommend the book to anyone trying to get a CS job.
 

posted @ Monday, November 7, 2011 4:08 PM | Feedback (2) |

Tuesday, October 18, 2011

Healthy Hair Tip

To have the healthy hair, with out hair loss and strong hair follow the below tip.

In the supermarkets you can get the Banjara's (Anything Other company also) Products with approx 200gm like that.

Take

1. Bringraj Powder

2. Methi Powder

3. Hibiscus Powder

4. Shikakai Powder

5. Bramhi Powder (Optional)

Mix all the above powders and keep the mix ready.

Once every 15 days, you take sufficint powder to apply throught  your hair, and mix the powder with water previous day's night you wanted to take headbath.

Next day you apply the mix to your sculp and wait till 1 hour, then wash it only with Water. Do not apply any Shampoo.

Next day after you washed your hair with water, you can take again headbath with Shampoo.

 

Results will be very good..

 

posted @ Tuesday, October 18, 2011 5:16 PM | Feedback (0) |

Monday, October 3, 2011

BroadBand swindle

This days few people doing fraud by telling that they will give BSNL Broadband connection with nice offers and they will tell that, you need to pay the money 2500/- before installation, so that you will get the connection with in one hour.

The guy will be having BSNL Id card with him, each and every detail he says as he is true BSNL agent.

He will give you the mobile number also. But after one hour it will not work.

So Please do not believe such kind of people who comes to your home and tell these things.

Lets stop and share this information so that till some extant it will be stopped.

posted @ Monday, October 3, 2011 2:19 PM | Feedback (1) |

ID card for BMTC VOLVO Bus Pass

The below information is useful for those who wants to take Monthly VOLVO pass.

1. The BMTC Volvo GOLD Pass is now 1500/-. (Without ID card)

2. The BMTC Volvo GOLD Pass is now 1450/- if you have an ID card with you.

3. As I know Only in Mejestic and ShanthiNagar you get the ID card, for that you need a stamp Size Photograph of yours.

    The ID card costs you only 100/- rupees and Valid for 3 years. Just you need to take the Id card from the counter then, fix your photo, sign on

     that then they will put a stamp on your ID and then does lamination.

4. On Sundays the counter will be closed. Rest of all the days it will be till 5PM.

5. Only from 1st to 7th you can get the Pass. (ID card I am not sure.)

6. In some posts I read that "We need to take ID card along with the PASS". That is not the case, If you just want the ID card you can take it. (In my case I had a pass already, but I wanted to Take ID card, for nextmonth purpose.)

 

posted @ Monday, October 3, 2011 2:09 PM | Feedback (1) |

Thursday, June 23, 2011

MS Outlook

By mistake while moving mials to a folder, if we forgot where the messages are is stored, the below content is helpful.

Find where a message is stored

  1. Open the message from the Search Folder.
  2. On the File menu, click Properties.

Next to Location, you can see the folder where the message is stored.

File properties dialog box

  This Information I got from http://office.microsoft.com/en-us/outlook-help/i-can-t-find-the-folder-where-a-message-is-stored-HA001140027.aspx

 

posted @ Thursday, June 23, 2011 12:20 PM | Feedback (1) |

Wednesday, March 9, 2011

Hiring Freshers @ Ness

Hiring fresher candidates (2010 pass out) for engineering development group. Please send your referrals to Sowjanya.kotra@ness.com  

posted @ Wednesday, March 9, 2011 4:29 PM | Feedback (1) | Filed Under [ Refferal Jobs ]

A world of opportunity for women in the SAP workforce

A world of opportunity for women in the SAP workforce

To celebrate the centenary year of International Women’s Day, SAP Labs India announces the launch of ‘Women in the SAP workforce’, to provide equal opportunities for women to join SAP. We want to recruit women (engineering graduates) having the right attitude and skill mix to start a career with us. Eligibility: * B.E/B.Tech/M.Tech Students from Computer Science / Information Technology Stream in the Final Year(2011 Graduates ONLY) * Minimum 70% aggregate throughout entire academic career Selection Schedule: * Notification of the online test – March 16, 2011 * Notification of the login details and timeline for the test - March 18,...

posted @ Wednesday, March 9, 2011 4:27 PM | Feedback (1) | Filed Under [ Refferal Jobs ]


Advertisements at BlogUnlimited.com