"A little progress everyday adds up to big results"
Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Sunday, 25 September 2016

Athena Health Interview Experience

                 On 6th and 7th February 2014, Athena Health, a product based company, took off-campus interview for the post of Quality Assurance Tester. Generally, dual placements are not allowed in my college (Sona College of Technology). But, two days before the interview, it was announced that dual placements are allowed for this company as the package was more. Till then, though I knew that this company is going to take a recruitment drive at my college, I had no idea of attending it since I had been already placed in Accenture. I was about to write the GATE examination in March to pursue higher studies (if I had got admission in a good institute). But then, just to give it a try and to get interview experience, I decided to attend the interview and started preparing for it.

Preparation
                 The day before the interview, one of my friends, Brabu, had collected a few Athena Health interview questions from the Internet and we both discussed the solutions in the college campus. When we were about to leave the college, unexpectedly, we met my department (IT) HOD (Dr. J. Akilandeswari), who had great faith in us. She wished us all the very best.

Pre-placement talk
                The interview process was held at my college, Sona College of Technology, Salem. Before the interview, there was a pre-placement talk, where the interview procedure, package, etc, were discussed. The facilities (said by them) like work from home, free health insurance for self and family, etc., impressed me and made me think that Athena was a better place than Accenture. Around 400+ students from several colleges in and around Salem had gathered in Sona Auditorium for the pre-placement talk on 6th February, which was followed by the interview.

Round 1 (Aptitude test)
               After the pre-placement talk, we were taken to the PG Auditorium for the aptitude round. The aptitude round consisted of 10 numerical type questions, for which choices were not given. The duration of this round was for an hour. Out of the 10, I could solve only 5. Later, I came to know that I got only 2 correct. As soon as we came out, we (friends) discussed the solutions amongst ourselves. We were really scared and were telling the placement coordinators that if we get selected in this round, the remaining rounds wouldn’t be that tough for us. After some time, the results (list of shortlisted candidates) were announced. Only 51 were qualified for the next round.

Round 2 (Programming)
                The programming round consisted of 3 questions.
1. Given a string made up of parentheses and an index, find the index of the corresponding (opening/closing) parenthesis.
My approach: Linear search and flag variable

2. Given an integer, output an integer formed by swapping the odd and even bits in the given integer.
My approach: Bitwise operators (Shifting operators, bitwise AND and bitwise OR)
(This question saved me a lot of time)

3. Arrange the characters in a string in the order given as another string.
My approach: Counting array for storing the order

              After completing the code, I started writing comments for them. On seeing it, one of the invigilators from Athena said that it was not expected. But, then since I had time, I did it for my satisfaction. There was no filtration in this round.

Round 3 (Test case generation)
              Given a 3 page program, we had to write test cases for it. Actually, this round was the biggest expectation of the company since the interview is for the role of testing. Though 20 to 21 test cases were expected, I could write only 13 test cases within the given time. Results for this round was announced via mobile at around 7 pm. Filtering was based on the cumulative score of the second and the third rounds. Only 7 students, including my best friends, Vignesh Jagadeesan, Ramki R and Brabu Venkatachalam got shortlisted for the next round. Five were from my college and the two others were from Government College of Technology, Salem.

Round 4 (Technical)
                  One to one (technical and HR) interviews were held on 7th February. My technical interview went for around an hour in placement coordinator's (Mr.Balamurugan) cabin. There was only one panellist. He asked me a lot of question in Database Management System as it was my area of interest. Most of the questions were based on joins. He also asked me to use the conditional operator in a query. I wrote such a query (using conditional operator). He asked whether it would work. I said that it would work in MySQL and added that I wasn’t sure whether it would work in the other DBMSs. He asked me to solve a question from the previous day’s aptitude round. I tried, but, couldn't find the answer, even after getting a hint from him.

                   Then, he asked a few questions from my second-year project, Musical Keyboard Simulator. He told me to write a small program something like removing duplicates in a string. I wrote it. The rest of the interview conversation is presented below. I have mentioned the panellist as 'Tech'.

Tech : Game me an aptitude puzzle and asked me to solve
Me    : (Solved it in some time)
Tech :  Can you explain how you solved
Me    : (Explained)
Tech : What will be the test cases when a user performs an ATM transaction?
Me    : Card validity, PIN correctness, balance sufficiency while withdrawing money, etc.,
Tech : Consider the card is valid, PIN is correct and sufficient balance is available in the account. But, still, the user is not able to withdraw money. How is it possible?
Me    : Cash is not available in the ATM..?
Tech  : No, it is available. Don't say "power cut", "connectivity issue". They are all perfect. The clue is, it is related to the user.
Me    : (Thought for a while) No idea, sir.
Tech  : This is very simple. I gave you the clue also. Try to get it.
Me     : (Again thought for a while) I don't know, sir. (Really nothing stroke my mind)
Tech  : User enters denomination, which cannot be dispensed. (which is not a multiple of 50/100)
Me     : Sssss..... (an expression to show that a simple thing is missed). I did not think about it, sir.
Tech  : You are here for the post of tester. So, you must think about it. In which company are you placed?
Me     : (Though, I was placed in Accenture, I was nervous to face many questions) I didn't get placed, sir.
Tech  : Why not Accenture?
Me     : I do not want to join service based company, sir.
Tech  : Why?
Me     : I have heard that there will be more stress in service based companies.
Tech  : (Reading about 'Software Developer' certification in my resume) Where is Carnegie Mellon University?
Me     : I think it is in USA, but, I am not sure.
Tech  : You have done certification, but, don't know where the university is.
Me     : I am sorry sir, it is my mistake. I will know about it.

                       Then, he asked a few questions from my resume. Finally, he offered me some snacks. As soon as I came out, I told my friends and placement team that I told him that I wasn't placed. Placement coordinator blamed me. I too realized my mistake. But, the placement team members asked me to maintain the same (not placed) throughout the rest of the interview. I really felt guilty.

                      It was very unfortunate that Ramki could not make it to the next round. My friends had two technical interviews, each of short duration. I had one single, but, long technical interview.

Round 5 (HR 1)
                      My nervousness raised during this round, which was held at the ECE conference hall. Let me call the interviewer (Mr. Ramesh), 'HR'.
HR    : No need to be nervous. Be calm. Please be seated. If you want, you can place your resume on top of the table.
Me     : Okay, sir. (felt little bit comfortable)
HR     : Tell a few lines about yourself.
Me     : (Told)
HR     : Why is your score low in aptitude round?
Me     : (Explained that I have given a try on all the ten questions)
HR     : Which of the rounds so far you liked the most?
Me     : Of course, the 2nd round (programming round)
HR     : Do you know the job role for which you are being interviewed?
Me     : Yes, sir. Quality Assurance tester
HR     : Yes. If you are selected, in future, you should not claim for the developer job, because, you are interviewed for the testing role. We let you know in advance because there are people who do it.
Me     : Okay, sir.
HR   : Including the salary, everything is common for both the developers as well as the testers at Athena. Only the job role differs. The moment you claim for a developer role, you will be fired.
Me     : I assure that I will not request for a developer role.
HR     : What is your expectation from the company?
Me     : Need some freedom in the company.
HR     : Like what?
Me    : For example, if I am late for the office on some day, due to unavoidable situations, I shouldn't be blamed. Of course, I can be questioned.
HR     : Regarding timings, Athena is very liberal. Where else are you placed?
Me    : I am not placed anywhere, yet, sir. (To maintain consistency from the previous round. But, felt very nervous to lie this time.)
HR     : Why?
Me     : Accenture came, but, I didn't attend as it was a service based company. I attended Microsoft interview when I had been to MSP annual summit to Dehradun as a Microsoft Student Partner. But, couldn't get it.
HR      : If Athena wouldn't have come, what you would have done.
Me      : I would have tried some other product based company.
HR      : You have anything else to ask?
Me      : No, sir.
HR      : Thank you. (with a handshake)

Round 6 (HR 2)
               When we were thinking that the interview process gets over with the 5th round, one by one, we were called for another HR round, which was held in the Image processing laboratory. The panellist of this round was Mr. Judah (HR).

HR    : I have no information from the previous panellists. So, you can freely speak to me. Run through your resume.
Me      : (Explained the highlights seeing the resume)
HR      : (Interrupted) Why can't you tell without seeing your resume?
Me      : Sure, sir. (Continued)
HR      : There are vacancies in both developing and testing roles. Frankly tell me which one you want, if I were to offer you?
Me      : (From the previous round, I learnt that he is checking whether I am sticking to testing or switching over) Testing is okay, sir.
HR      : Why you wouldn't like to be a developer?
Me      : A good tester must also be a good developer, sir. Testing is more challenging than developing, because, in testing, there is no freedom of logic.
HR      : Where are you placed?
Me      : I am not placed anywhere, sir. (Again with full fear)
HR      : Why not in Accenture?
Me      : I don't want to get placed in a service based company, sir.
HR      : Why so?
Me      : I have heard that pressure will be more in service based companies since the deadlines are given by the clients.
HR      : How will you rank yourself in programming in your college?
Me      : (After thinking for 3/4 seconds) May be within 10, sir.
HR      : If you can't work in Accenture, then, how will your friends be able to work?
Me      : Yes sir, but, I don't want to join a service based company.
HR      : What is your GRE score?
Me      : Pardon, sir?
HR      : What is your GRE score?
Me      : I haven't written GRE, sir.
HR      : Why can't you do higher studies?
Me      : (Though actually I wanted to do higher studies) I wanted to see things in a practical manner, sir.
HR      : Who said your masters will be theoretical?
Me      : Except laboratory exercises and project, the others will be theoretical, sir.
HR      : (Gave me a form) Sit outside and fill this.

                      The form asked for some personal information, GATE score, GRE score, etc. Finally, there was an undertaking saying that, "If I were selected at Athena, I will join, otherwise _____________________________". The sentence was incomplete. On seeing that, I felt very nervous as I will not be joining the company if I get admission in a good institute based on GATE score.

                      After a long hesitation, I went out to approach the placement coordinator. He took the form back to the recruitment team and said, "There is a bug in your form", with a smile. The team asked to strike out that particular incomplete sentence. Then, again Mr. Judah called me and said, "If I ask you to sit at some place, you shouldn't leave the place until I say.". Angry was seen on his face. I said, "Sorry, sir. I had doubt. That's why I ......". "If you have doubts, you have to ask me.", he told.

                      Then, he looked at the form which I had filled and said "There is a bug in the form you filled", pointing out the date below the sign. The date was 7.2.2013, instead of 7.2.2014. Both of us smiled and he corrected it himself in red pen.

Results
                       I felt extremely nervous before the declaration of results. Actually, it was said that only one will be selected. When the recruitment team was discussing about the results, the placement team members of my college asked me, if I will be definitely joining on selection. They said, if I will not be joining, they would ask the recruitment team to select someone else, who will be given an opportunity. I told them that if selected, I would definitely join. If I were the one, then, it is very difficult to deny the job, even if I would get a good GATE score. Then, I will be forced to join a testing job, which I didn't like previously. Finally, I came to a conclusion that if I had got selected, I would go for the job for a year and then go for higher studies; otherwise, I would either join Accenture or go for higher studies, if admission is obtained in a good institute. To be short, I left the decision to God.

                      I was nervous because I was the only one to have one technical interview. Hence, people (including me) thought that I had better chances of getting selected, which might ruin (or delay) my dream of doing higher studies. Vignesh, my best friend, was nervous because he was not called for the 6th round for a long time. Then, placement coordinator (Mr. Bala) asked Mr. Judah, “What about Vignesh?”. Mr. Judah replied, “The process is not yet over, sir”. Then, after some time, Vignesh was interviewed for the 6th round. Since he was the last one to be interviewed (after a request had been made), his face turned bad.

                       But, to everybody's wonder, something different happened. God has made something unexpected and gave back the decision to me. Athena has recruited all four students (Vignesh. J (CSE), Brabu. V (IT), Amrish Khanna (CSE) and myself (IT)) of Sona College. I felt really so happy. My face turned back to normal.

The surprise
                  On the same day, there were college cultural selections for performance on Annual day. To see that, the whole college (students and staff) had gathered at the open auditorium. Saying that we are going to meet the college Secretary, at his cabin, we were unexpectedly taken to the open auditorium stage. Placement coordinator introduced us to the crowd and made us proud.



Each and everyday, something unexpected is expected to happen !

Monday, 12 January 2015

A C program without main

               As soon as you see the title, you might be wondered whether this is possible. But, it's actually possible.  

#include<stdio.h>

#define modify(t, r, a, i, n, s) i ## t ## a ## r
#define change modify(a, n, i, m, a, l)

int change()
{
    printf("C without main!\n");
    return 0;
}


            If you still don't trust this program, compile and execute it. Shocked ? In fact, there is a main in this program, but hidden. This is based on the concept of token pasting. What happens here is, change is initially replaced by modify(a, n, i, m, a, l). The arguments are then replaced as follows
t = a
r = n
a = i
i = m
n = a
s = l

           The statement i ## t ## a ## r gets changed to m ## a ## i ## n, which is then concatenated as main. Eventually, 'change' is changed to 'main'.  Since all these steps take place even before compilation (at the macro expansion stage), the compiler does not throw an error.
Now, become a magician by showing this trick to your friends! 

C Programming : Display only the significant digits after decimal point

Problem:
 
             In C++ programming, if we give the statements,

float pi = 3.1400f ;
cout<<pi ;

only 3.14 ( significant digits ) will be shown. 
          
             But, in C program , if we give
float pi = 3.1400f ;
printf ( "%f", pi ) ;

3.140000 will be displayed. 
            
The '%g' format specifier:      
       Of course we can use %0.2f. But, we may not always know how many decimal digits are there? In such situations we can make use of %g,


float pi = 3.1400f ;
printf ( "%g", pi ) ;

will print 3.14
 
Now, say 'Hi' to %g

C Programming : The (input) buffer problem

                      Usually in C programming, whatever we type gets stored in the keyboard buffer (temporary storage) and then the CPU takes input from the buffer. If a scanf is used to read input, this buffer is inspected first. If the input is available in the buffer itself, it is taken directly and the scanf statement terminates. Only if the buffer does not have the requested input, the user is prompted for input.
             
                    Whenever we input a number (int, float or double), we give the number and press enter to specify that our input is ready to be taken. Both (number and enter) are stored in the buffer.

                         After enter is pressed, the number gets stored in the (int, float or double) variable. But, where does the enter go? Yes, it remains in the buffer. Next time when a character or string is to be given as input, this enter will be taken directly from the keyboard buffer and we will not be prompted to input the character or string.

Example:
1.#include<stdio.h>
2.
3.int main()
4.{
5.          int num ;
6.          char ch ;
7.          printf ( "Number: " ) ;
8.          scanf ( "%d", &num ) ;
9.          printf ( "\nCharacter: " ) ;
10.        scanf ( "%c", &ch ) ;
11.        printf ( "%cBye", ch ) ;
12.        return 0 ;
13. }

Output:
Number: 2
Character:
Bye

Explanation:
2 is stored in num and '\n' ( enter ) is stored in ch.

Solution 1:
To get rid of this let us use getchar() before the second scanf(), that is at line number 10. getchar() takes the enter from the buffer. But, since we didn't assign it to any variable, it gets wasted (removed from the buffer).

Solution 2:
Instead of using getchar(), we may get the character twice, that is use scanf ( "%c %c", &ch, &ch ) ; instead of scanf ( "%c", &ch ) ; In this case, first enter is stored in ch and later, the input we give replaces it.

The best solution:Which one of the above do you think is the best solution? If you think it is solution 1, then you are wrong. If you think it is solution 2, then also you are wrong. Both of the above are only solutions, but not the best. The best and right solution is to clear the buffer using the inbuilt function.

              If you are a Turbo C programmer, use the following statement before line 10.
fflush (stdin);

                If you are a gcc programmer, use the following statement before line 10.
__fpurge (stdin); // It is double 'underscore' followed by fpurge
and include <stdio_ext.h>

Do not get caught in the buffer jail!

A C program without semicolon

C program to display “India” without using ';' anywhere in the program:

                           Before writing this program, we should first understand what printf returns and its prototype. The function declaration of printf is
int printf ( const char *, ... ) ;
                          It takes variable number of arguments, displays the string till a NULL character is found and returns the number of characters printed.

Now, the program:

#include<stdio.h>
void main()
{
    if ( printf ( "India" ) )
    {
    }
}

The printf () returns 5 in this case. Hence, the 'if' condition is true, but, we are not doing anything inside the block of 'if'.

Next time if someone asks you whether you can write a C program without semicolon, reply 'yes'

C Programming: Let the user specify the number of decimal digits after the decimal point

                   In a C program, what will we do if we want to display only specific number of digits (which is determined at run time, like user input) after decimal point? We can get the number from the user, put it in switch() and provide a case for each individual number, as follows.


int num;
float pi = 3.1415
93;
printf ( "Enter the number of decimal digits to be shown: ");
scanf ( "%d", &num );
switch ( num )
{
case 1 : printf ( "%0.1f", pi ); break ;
case 2 : printf ( "%0.2f", pi ); break ;
...................
}

                    But, is it possible to give for each and every number? Moreover, this is not the correct way of programming. Use it in a single statement, instead of switch.


int num;
float pi = 3.141593;
printf ( "Enter the number of decimal digits to be shown: " );
scanf ( "%d", &num );
printf ( "%*.*f", 0, num, pi );
 
This will display 'num' digits after the decimal point. In the last statement, the first asterisk is replaced by 0 and the second asterisk by the value of 'num'.

Give full freedom to the user!

Sunday, 16 September 2012

Clear explanation of Java's Ugly Syntax

Introduction:
               Most of the Java programmers might have worked with the (Ugly) syntax of an anonymous class. This post will cleanly explain the Ugly syntax (especially with Anonymous classes) of Java. For example,  consider the button click event in Java Swing.

class EventHandler implements ActionListener
{
         public void actionPerformed(ActionEvent e)
         {
                     // Code that handles the event
         }
}

// Somewhere else
ActionListener e = new EventHandler();
button_object.addActionListener(e);


This is a very straight forward way, where each and every process is done step by step. Now, before moving on to the equivalent ugly syntax code, we must be knowing 5 Java concepts.

1. Interface object concept:
                                 An interface can have an object to which, an object of one of the classes implementing it, can be assigned. For example, in the above code, ActionListener is an interface and e is an object of it. We have instantiated e by invoking the new operator on the EventHandler class (which implements the ActionListener interface).

2. Anonymous object concept:
                                 The synonym for the term 'Anonymous' is 'nameless'. There might be some situations when we would require the object of a particular class, in just one statement. In such cases to avoid 2 lines of code, we may go for an Anonymous object. 

For example:

ActionListener e = new EventHandler();

button_object.addActionListener(e);


could be written as

button_object.addActionListener(new EventHandler());

                           This is done purely to reduce the lines of code; however doing so affects the readability of the code, whereas the efficiency of the code remains unaltered.

3. Method implementation specific to an object:
                                While writing multi-threading code in Java, one might have written code something like this.

Thread t = new Thread()
{
          public void run()
          {
                   // Thread code
          }
};


One can say that this code implements the method run(), which is specific to the object t.

4. Method implementation specific to an instance of an interface:
                          This is nothing but the combination of the concepts 1 and 3. This concept will be well understood with the following examples.

Runnable t = new Thread()
{
     public void run()
     {
          // Thread code

     }
};


Using this concept with the ActionListener interface,

ActionListener e = new EventHandler()
{
          public void actionPerformed(ActionEvent e)
         {
                     // Code that handles the event
         }
};


5. Anonymous class concept:
                              Bit tricky to understand, but would be simple with an example. The syntax of an anonymous class is
new <Implemented interface/Super class>()
{
           // Code inside the class
}

For example,
class A
{
       // block of A
}
interface B
{
       // block of B
}
class C extends A implements B
{
       // block of C
}
class Main
{
        B b = new B()
        {
               // methods of the interface B are implemented here
        };
}

                
Putting them all together:                        
                            Now, we are going to put them all together. So, the click event code (mentioned in the second paragraph) can be written as follows.

button_object.addActionListener ( new ActionListener()
{
        public void actionPerformed(ActionEvent e)
        {
            // Code that handles the event
        }
} );


                Well...! Hope you might have understood. If not, please don't worry, you will understand it when you use these concepts in your code.

Now tell me, isn't Java interesting and challenging ?

Sunday, 9 September 2012

Running Java Applet in free website domain

                           As a Java programmer, everyone will know that Java can be embedded in Web pages as Applets. This post will show how an Applet can be embedded in a Web page, which is hosted in a free domain.

Step 1: Make the Java applet source file ready.
Step 2: Compile the Java applet to get the class file.
Step 3: Write an HTML code, embedding the Applet.
Step 4: Create a free domain using one of the free hosting services like 000webhost
Step 5: Upload the .class and the .html files into the same directory

Share the URL with your friends and enjoy!

Sunday, 2 September 2012

Effective utilization of resources


                Initially I would like to inform that this post is not to hurt anybody. The only intension of this post is to make people to utilize the available resources efficiently

             We, the homosapiens, keep telling that certain resources are not abundantly available. Now-a-days, electricity is very scarce in India. This is very evident as most of us might have been facing many problems because of frequent and unannounced power cuts.

                  Do you think that electricity is really insufficient ? That might be true to some extent, but, what I feel is that some people are overusing (and thereby wasting) it. The variations are very drastic in the country. When there is a group of people suffering because of power cut, there is a group which consumes electricity without any use. There are some people who are waiting for the power to type their documents in a computer. There are also people who keep their computer turned on the whole day whether or not they are using it.

                   Petrol hike keeps persisting because of the inefficient usage of it. People start preserving a thing, only when there occurs a scarcity. If a certain resource is abundantly available, we use it to a greater extent. Why not we preserve that particular resource inspite of its abundant availability ? We expect certain things as a rule. For example, some of us use helmets for the sake that it's compulsory and not for our own safety. Another example is the rain water harvesting scheme of Tamil Nadu government a few years ago.

                     I don't mean that we should limit the usage of resources. My point is that don't use any resource unless it is needed (or in other words, don't unnecessarily use any resource).

"It's our duty to leave behind all the resources to our future generations"

Tuesday, 28 August 2012

Curriculum Vitae structure

                         The following is the curriculum vitae structure suggested by Infosys during my industrial visit with my friends.

1. Contact address
2. Educational designation in the order college, 12th, 10th
3. Career objective
4. Project experience
5. Project achievement
6. Work experience (in NGOs etc)
7. Rewards and recognitions
8. Extra-curricular activities
9. Extra-curricular activities (non-technical rewards and recognitions)
10. Personal details

Monday, 27 August 2012

Common interview questions

              On 25th August, 2012, I had been to Infosys, Bangalore with my friends as industrial visit. There, common interview questions were discussed by the Infosys workers. Those questions are listed below.

1. Tell me about yourself
2. What are your career goals (short term and long term)?
3. Why do you prefer to work with us?
4. What is your biggest achievement in life?
5. How do you handle failure?
6. How do you deal with the change?
7. What salary do you expect?
8. Would you like to ask us any questions?
9. What is unique in you?
10. What are your likes and dislikes in teamwork?
11. How have you contributed for events in your college?
12. How do you update yourself?
13. What are the frequent websites you visit or frequent books you read?
14. What is your favorite pastime?

Tuesday, 31 July 2012

Earthing your PC to prevent shocks

                   Sometimes, if the power line of the house is not connected to earth properly, we might get shock on touching electronic devices. I used to get shock whenever I insert pen drive to my system. So, whenever I insert a pen drive to my system, I kept my feet in the air so that there is no physical contact between my body and the ground. Though this solved the problem temporarily, I needed a permanent solution. As we (my parents and I) were staying in a rent house (in the first floor of the building), I couldn't do the conventional earthing.

                             When I consulted the situation to an electrician, the solution given by him was so simple. "Fill a small pot/jug with sand, connect one of the USB ports with the sand by means of any wire and keep the sand wet all the time". This was the suggestion given by him. I tried the same and now, everything is fine and there are no more shocks.

"For every big problem, there is a simple solution"

Saturday, 28 July 2012

Mounting

What is mounting?

                       In modern computing, mounting plays an important role. In layman terms, mounting is making a drive/archive to act as a directory or making a directory to act as a drive, though that is not the exact/right definition.

Where is mounting used?

                             Mounting is used in several places like looking for the contents of an iso image without burning them to a CD, using Windows partitions from Linux OS, etc. Let's discuss a few applications of mounting and how to use the mounting facility.

Running Turbo C from Dosbox:

                               Many novice C programmers, especially those who use Windows 7 platform for programming, make use of a third party software called Dosbox. To run Turbo C from dosbox, the very first command is mounting, which goes as
mount c: <directory_path>
Here, the entire directory acts as the C: drive and for any action that is being performed within Turbo C, the <directory_path> has to be considered as C: drive. Here as you can see, the directory is treated as drive.

Mounting devices in Ubuntu:

                        Ubuntu, one of the famous operating systems of Linux, uses auto-mount concept. Once you click on a Windows drive icon, Ubuntu automatically mounts that drive in the /media/<directory_label>/ directory. If the directory already exists, then an '_' is added as a suffix to the <directory_label>. Even when you insert pen drive, it is auto-mounted in the /media/<pendrive_label>/ directory. Here, a drive is treated as a directory. Though Ubuntu supports auto-mounting, sometimes we might need manual mounting also.

Manual mounting in Ubuntu using Terminal:

                          To manually mount a device in Ubuntu, we first create an empty directory in the required directory, by using the command
mkdir <dir_name>
To know the list of available devices, run the command
sudo fdisk -l
Now, mount the required device, using the command
sudo mount <device_name> <dir_name>
Now, you can see the contents of the device, in the <dir_name> directory. To unmount, use the command
sudo umount <dir_name>
Note: The spelling is umount (no 'n') and not unmount.

Mounting with permissions:

                                 If we normally mount pen drives (either auto-mount or manual mount), then we won't be able to run any application from pen drive. To mount a device with permission to run applications, use the command.
sudo mount -o umask=0 <device_name> <dir_name>

"Mounting is a powerful feature, if you know how to use it"

Tuesday, 26 June 2012

The power of NDK in Android

                     While developing android applications, sometimes, one might want to perform CPU intensive operations like huge number of calculations. In such cases, the time taken for performing those operations might be so high, so that the user gets frustrated. Of-course, one can run such operations as a Service ( background task ) and intimate the user on completion via notification; but, there is a better alternative in Android, called Native Devleopment Kit ( NDK ), which allows development from C/C++ instead from Java.

                       It is simply the equivalent of Java Native Interface ( JNI ) in Java. This is nothing but, calling C/C++ functions from Java. If one has a very basic knowledge of JNI, then it's not at all a matter for him/her to develop application in NDK. I faced this situation once, when I developed Speaker Recognizer application for android as a part of my internship at IIIT, Hyderabad. I had written the entire code in Java and the code executed nearly for about 40 seconds on a device with operational frequency 600 MHz. When I reported this to my project guide, Dr. Kishore S. Prahallad, he suggested me NDK.

                      I thought that C/C++ would be some 2 or 3 times faster than Java. But, to my surprise, my code executed in just 4 seconds on the same device, which is almost 10 times faster. I was wondered and realized that C and C++ are nearly 10 times faster than Java on Android devices. So, if you want to perform CPU intensive operations on android, I suggest NDK. The entire tutorial is available at this site.

Functional testing of your mobile

                       Almost all possess at least one mobile phone now-a-days. Sometimes, some of the features in the mobile might not be working. In such cases, you yourself can test what has went wrong by following some simple steps as given below.

1. Bring your mobile to the home screen ( Unlock if necessary )
2. Press right arrow key once
3. Press * once
4. Press left arrow key twice
5. Press * once
6. Press left arrow once
7. Press * once
8. Now, you can see a menu. Select a one which has 'Testing' or 'Test' term
9. You can now, select the functionality that you want to test.

Note:
1. Perform these operations at your own risk. You can use 'back' button to return back.
2. The key order might change on some mobiles.