While travelling with Indian Railways, sometimes especially during long journeys I experience my phone's battery falling short of electron flow. Although in AC boggies they provide charging points near every berth but not everyone always travels in AC boggies. In sleeper boggies, in most trains they do provide 4 charging points in every boggy but they aren't enough and occupied most of the time by rogues who keep listening to music in full volume with their phones' speakers while charging, hence not letting others charge their phones.
One such situation at hand, and the inquisitive me started thinking of something cool that would work perfectly. I stood at the gate of my boggy feeling the wind at 100KM/hr(that was train's direction in east, so wind's velocity for me was 100KM/hr in the west) with my palm, and then came the EUREKA moment!!!! A smile spread throughout my face. Yeah, I had got the idea! Why not someone build a portable wind powered mobile charger?
How will it work? There can be a wheel with blades which will rotate fast when wind strikes it. The wheel and axle machanism should be connected to a dynamo, a small one used in bicycles for lighting. A 12V/3W will work perfectly. Now the passenger can take his/her hands out of the window or may even stand at the exit gate holding the whole thing in his/her hand. When wind falls on the wheel, it rotates, in turn rotating the dynamo axle which produces an alternating current. Using a rectifier it can be converted to DC. A capacitor with appropriate specifications can be used to smoothen the waveforms produced by the rectifier. This output can be fed to a IC7805 which stabilises the voltage at 5V DC which is required by most mobile phones for charging. Take this output, connect it to a multi-model pin connector which can be used to charge any brand's phone. Now pack this whole makeup in a cool looking case, label it and sell it!!!! Done! Earn loads of money.
It will be very helpful for the travellers who can very practically stay online during long journeys keeping their cellphones charged :)
Thursday, June 10, 2010
Sunday, June 6, 2010
IIIT-Allahabad M.Tech selection process
With this article, I'll acquaint the reader with the full interview process of IIIT-Allahabad M.Tech Course in Software Engineering, linking with my own experience of my selection.
If you are just preparing for GATE, you should solve more and more questions. And for that I would recommend GKP Publisher's Question Bank. Although there are some mistakes in the book for solutions to some problems, but I recommend this book solely for the huge collection of problems it has.
After an initial shortlisting based on GATE scores, names of 148 students were posted on their site who were called for the Written Test + Coding Test to be held on 1st of June and Interview of qualified students on 2nd. I received my admit card 7 days before the test. Kudos to Bharatiya Daak for their crappy service, a friend of me had received 15 days ago.
I reached Allahabad on 31st May night, and stayed at a relative's residence. On 1st June I reached IIIT-A campus at around 8:30. The auto-fare from station is just Rs.5 so don't think that being in the outskirts of the city it is very far as mentioned in Admit Card that the fare would be Rs.70-100. I guess, it is around 7-8 kilometers from railway station.
I was greeted by the guards, who were very co-operative. I was directed towards the boys hostel. I entered the mess. To my surprise, it was completely Air Conditioned and very well maintained and clean. I drank some water and cooled myself, as the North Indian heat had struck me on the way hard! Yes, at 8:30AM it was very hot in Allahabad! I believe, the temperature was 42+ at that time! In the mess itself I met my net friend Shailesh Sharma who too was shortlisted and had arrived for the admission process. We had got introduced to each other through this blog itself through my post GATE-2010 Solutions. I got introduced to his friend Vipin and we were now a group of three! At 9:30 we headed out towards the academic campus. Our written test started at 10.
The paper consisted of 100 objective questions to be solved in three hours. There were tricky questions from C, followed by Java, some very easy questions from data structures, some easy ones from SQL, and then from software engineering. Overall, the paper was deviating 80% from the provided syllabus. In first 20 minutes, C questions had trapped me and I had solved only 10 of them. Later I changed my gear and by the end of 50 minutes, I had marked all 100 questions. There was no negative marking so there was no fear of wrong answers. Marking the answers on the answer sheet took me another 40 minutes because of bigger bubbles and use of ball point pen for filling the bubbles. The question paper lacked quality standards. There were inconsistent questions, and weird ones too. Some seemed to have wrong options too. Anyways, we finished. I believe, I must have got around 70 questions right. We headed out for lunch.
At 2PM we went for the coding test. The lab had computers running Windows and Linux(Ubuntu 9.04). Student was free to choose his/her environment. I chose windows thinking that they may put me on vi editor if I chose Linux and as I am not much comfortable with vi, as well as touch typing. I saw that there was no CUI, but a GUI environment had been provided on Linux systems so I switched to a Linux system thinking about the added advantage of synatx highlighting of gedit. Windows people had option to use Turbo C++, or Microsoft Visual C++ or Dev C++. Linux users had good old GCC.
All the computers were on LAN and we had to open a URL in our browsers where Online Judge software was running. The software was coded in PHP. We had to upload the source file after coding. The compilation and evaluation on random inputs was to be done by the software itself. If the software was satisfied with our code it would give us points. But there was a catch. The way of giving input was pre-specified and exactly the program was required to receive input that way only. And the required output too was given in a pre-specified manner. This was because the code was run by a script, not a human being. Being dumb, a script can't accept anything deviating even slightly from the specified standards.
There were three questions in the paper. First was of 20 marks. Second one of 35 and third one of 45 marks. The time alotted was 3 hours. The questions were easy but I felt that I'll have problems in designing the input module because the language to be used were C or C++. I thought, if I were allowed to use PHP, I would churn out these questions within 5 minutes each. explode() function in PHP would easily let me process the input, the way I wanted. But I had to work with C and there was no explode. I was unable to take the input in required form and put it into a data structure for further processing and output. I coded the processing and output modules for 1st and 3rd questions but couldn't code the input module. Then I attacked the 2nd question and cracked it easily. I was sweating heavily in the Air Conditioned lab. As soon as my 2nd question's answer was accepted by the script I took a sigh of relief.
I checked the time and 2 and half hours had passed already. I checked the current results. This facility was provided by the Online Judge software. We could see which student had submitted correct answers. There was one girl at rank 1 who had solved 2 questions i.e. 1 and 3. She had 65 points. I was at rank 2 with 35 marks because 2nd question was worth 35 marks. There were 15 students behind me, each with 20 marks, who had solved the first question. Out of the rest, noone else could solve any program!!!
I re-attacked the 3rd question to process the input anyhow. I cursed myself for forgetting the strtok() function's syntax which would easily let me solve the 1st and 3rd questions. Strtok() works a bit similar to the explode() function in PHP. I thought I should code my own explode() function in C and I started off for the same. I reached very near but the time was up, by then! I checked current rankings. I was still at rank 2, behind that girl.
The authorities announced that those whose programs were running manually but were not accepted by the Online Judge software could get their programs verified by invigilators and get some marks. Many students who were not in Online Judge's ranking list raised their hands and were getting their programs verified. Some claimed that they have solved all three but none was accepted by online judge. I thought in my mind, even if they get more marks and I get rejected I'm still a better programmer than them because my program followed the standard defined in the problem. Anyways, the process ended after sometime. We were advised to wait for an hour for the declaration of result. We roamed through the college. At around 7PM the result was declared. Out of 148 appeared, 56 were shortlisted for the interview to be carried out next day. I was there in the list!
Shailesh and Vipin too were there. We bid good night and parted away happily thinking about the next day.
On 2nd day, we reached for the judgement day! Everyone was in formals. We were made to sit in the auditorium from where we were called for the interview one by one based on the roll number. My roll no. was 142 so I was relaxed that my interview will take time. First Vipin was called, being early in the sequence, followed by Shailesh. Finally my turn came. My interview went very pathetic. When I was asked 'tell me about yourself', I mentioned about IndiFun. Then I was asked 5 questions from the theory of social networking each going well above my head.
Then I was caught by another interviewer who was a guest lecturer from IIT Khargapur. He asked me my favourite subject. I said - databases! He asked me to define functional dependency. I spoke: an attribute B is said to be functionally dependent on an attribute A if for each unique value of A there exists a unique value in B. Then he asked, what is the mathematical term for that. Within a fraction of second I recalled about functions and two obvious answers came to my mind - one one, and one one onto. I was also frustrated due to the early 5 questions that had gone beyond me. I spoke one one onto and felt that I've made a blunder!!! He asked, where did you read this? I said Elmasri and Navathe. Then after a pause of a second, I continued, I read about functional dependencies in Elmasri and Navathe but not the fact that this is one one onto function. Then he asked, considering functional dependency define 3NF. I got confused over 3NF and BCNF. I started speaking about BCNF then stopped, beg pardon and said a table is in 3NF if it is in 2NF and every non-key attribute is non-transitively dependent on all the candidate keys. He said go.
I went out thinking about those 5 questions that hit me in a row. I thought I don't need to see the result, as I won't be selected. But a hope kept me on. The result was declared at 7. Out of 56, there were 15 selected in General category! My name was there at 9th position in the alphabetically sorted list!
I had a sigh of relief! Finally I got into an India level institution. Shailesh and Vipin too made into the 15 lucky people list. I believe the final result was made up based on GATE score, written test score, coding test score and interview, where interview had a lesser weightage. If it had higher weightage, I would have definitely been ousted!
Our classes are going to start from July 9th. That was my experience with IIIT-A selection process :) Will keep you posted with the further developments in my life/career.
If you are just preparing for GATE, you should solve more and more questions. And for that I would recommend GKP Publisher's Question Bank. Although there are some mistakes in the book for solutions to some problems, but I recommend this book solely for the huge collection of problems it has.
After an initial shortlisting based on GATE scores, names of 148 students were posted on their site who were called for the Written Test + Coding Test to be held on 1st of June and Interview of qualified students on 2nd. I received my admit card 7 days before the test. Kudos to Bharatiya Daak for their crappy service, a friend of me had received 15 days ago.
I reached Allahabad on 31st May night, and stayed at a relative's residence. On 1st June I reached IIIT-A campus at around 8:30. The auto-fare from station is just Rs.5 so don't think that being in the outskirts of the city it is very far as mentioned in Admit Card that the fare would be Rs.70-100. I guess, it is around 7-8 kilometers from railway station.
I was greeted by the guards, who were very co-operative. I was directed towards the boys hostel. I entered the mess. To my surprise, it was completely Air Conditioned and very well maintained and clean. I drank some water and cooled myself, as the North Indian heat had struck me on the way hard! Yes, at 8:30AM it was very hot in Allahabad! I believe, the temperature was 42+ at that time! In the mess itself I met my net friend Shailesh Sharma who too was shortlisted and had arrived for the admission process. We had got introduced to each other through this blog itself through my post GATE-2010 Solutions. I got introduced to his friend Vipin and we were now a group of three! At 9:30 we headed out towards the academic campus. Our written test started at 10.
The paper consisted of 100 objective questions to be solved in three hours. There were tricky questions from C, followed by Java, some very easy questions from data structures, some easy ones from SQL, and then from software engineering. Overall, the paper was deviating 80% from the provided syllabus. In first 20 minutes, C questions had trapped me and I had solved only 10 of them. Later I changed my gear and by the end of 50 minutes, I had marked all 100 questions. There was no negative marking so there was no fear of wrong answers. Marking the answers on the answer sheet took me another 40 minutes because of bigger bubbles and use of ball point pen for filling the bubbles. The question paper lacked quality standards. There were inconsistent questions, and weird ones too. Some seemed to have wrong options too. Anyways, we finished. I believe, I must have got around 70 questions right. We headed out for lunch.
At 2PM we went for the coding test. The lab had computers running Windows and Linux(Ubuntu 9.04). Student was free to choose his/her environment. I chose windows thinking that they may put me on vi editor if I chose Linux and as I am not much comfortable with vi, as well as touch typing. I saw that there was no CUI, but a GUI environment had been provided on Linux systems so I switched to a Linux system thinking about the added advantage of synatx highlighting of gedit. Windows people had option to use Turbo C++, or Microsoft Visual C++ or Dev C++. Linux users had good old GCC.
All the computers were on LAN and we had to open a URL in our browsers where Online Judge software was running. The software was coded in PHP. We had to upload the source file after coding. The compilation and evaluation on random inputs was to be done by the software itself. If the software was satisfied with our code it would give us points. But there was a catch. The way of giving input was pre-specified and exactly the program was required to receive input that way only. And the required output too was given in a pre-specified manner. This was because the code was run by a script, not a human being. Being dumb, a script can't accept anything deviating even slightly from the specified standards.
There were three questions in the paper. First was of 20 marks. Second one of 35 and third one of 45 marks. The time alotted was 3 hours. The questions were easy but I felt that I'll have problems in designing the input module because the language to be used were C or C++. I thought, if I were allowed to use PHP, I would churn out these questions within 5 minutes each. explode() function in PHP would easily let me process the input, the way I wanted. But I had to work with C and there was no explode. I was unable to take the input in required form and put it into a data structure for further processing and output. I coded the processing and output modules for 1st and 3rd questions but couldn't code the input module. Then I attacked the 2nd question and cracked it easily. I was sweating heavily in the Air Conditioned lab. As soon as my 2nd question's answer was accepted by the script I took a sigh of relief.
I checked the time and 2 and half hours had passed already. I checked the current results. This facility was provided by the Online Judge software. We could see which student had submitted correct answers. There was one girl at rank 1 who had solved 2 questions i.e. 1 and 3. She had 65 points. I was at rank 2 with 35 marks because 2nd question was worth 35 marks. There were 15 students behind me, each with 20 marks, who had solved the first question. Out of the rest, noone else could solve any program!!!
I re-attacked the 3rd question to process the input anyhow. I cursed myself for forgetting the strtok() function's syntax which would easily let me solve the 1st and 3rd questions. Strtok() works a bit similar to the explode() function in PHP. I thought I should code my own explode() function in C and I started off for the same. I reached very near but the time was up, by then! I checked current rankings. I was still at rank 2, behind that girl.
The authorities announced that those whose programs were running manually but were not accepted by the Online Judge software could get their programs verified by invigilators and get some marks. Many students who were not in Online Judge's ranking list raised their hands and were getting their programs verified. Some claimed that they have solved all three but none was accepted by online judge. I thought in my mind, even if they get more marks and I get rejected I'm still a better programmer than them because my program followed the standard defined in the problem. Anyways, the process ended after sometime. We were advised to wait for an hour for the declaration of result. We roamed through the college. At around 7PM the result was declared. Out of 148 appeared, 56 were shortlisted for the interview to be carried out next day. I was there in the list!
Shailesh and Vipin too were there. We bid good night and parted away happily thinking about the next day.
On 2nd day, we reached for the judgement day! Everyone was in formals. We were made to sit in the auditorium from where we were called for the interview one by one based on the roll number. My roll no. was 142 so I was relaxed that my interview will take time. First Vipin was called, being early in the sequence, followed by Shailesh. Finally my turn came. My interview went very pathetic. When I was asked 'tell me about yourself', I mentioned about IndiFun. Then I was asked 5 questions from the theory of social networking each going well above my head.
Then I was caught by another interviewer who was a guest lecturer from IIT Khargapur. He asked me my favourite subject. I said - databases! He asked me to define functional dependency. I spoke: an attribute B is said to be functionally dependent on an attribute A if for each unique value of A there exists a unique value in B. Then he asked, what is the mathematical term for that. Within a fraction of second I recalled about functions and two obvious answers came to my mind - one one, and one one onto. I was also frustrated due to the early 5 questions that had gone beyond me. I spoke one one onto and felt that I've made a blunder!!! He asked, where did you read this? I said Elmasri and Navathe. Then after a pause of a second, I continued, I read about functional dependencies in Elmasri and Navathe but not the fact that this is one one onto function. Then he asked, considering functional dependency define 3NF. I got confused over 3NF and BCNF. I started speaking about BCNF then stopped, beg pardon and said a table is in 3NF if it is in 2NF and every non-key attribute is non-transitively dependent on all the candidate keys. He said go.
I went out thinking about those 5 questions that hit me in a row. I thought I don't need to see the result, as I won't be selected. But a hope kept me on. The result was declared at 7. Out of 56, there were 15 selected in General category! My name was there at 9th position in the alphabetically sorted list!
I had a sigh of relief! Finally I got into an India level institution. Shailesh and Vipin too made into the 15 lucky people list. I believe the final result was made up based on GATE score, written test score, coding test score and interview, where interview had a lesser weightage. If it had higher weightage, I would have definitely been ousted!
Our classes are going to start from July 9th. That was my experience with IIIT-A selection process :) Will keep you posted with the further developments in my life/career.
Labels:
Institutes,
Interview,
My Life
For Indian Railways
This is to draw the kind attention of competent authorities in Indian Railways.
I, on behalf of student community, and as a proud and aware citizen of India, want to draw the attention of proper and competent authorities towards the fraud and corruption looming large in IRCTC catered service which is leading to the plight of passengers, especially those travelling in Sleeper Class. I'm also incorporating some suggestions, which if implemented will result in better customer satisfaction.
1. Water: As far as I know, it was made mandatory that IRCTC would sell only Rail Neer branded mineral water bottles in the train. May be I'm wrong about this fact, I've experienced personally that the water/drink vendors are selling all brand waters except Rail Neer. I ask for Rail Neer and they say, it's not available, take Bailey or IceLing or Yes. I won't mind if the quality of water is good for the same price of Rs.12. But, the striking thing I saw that those small kids, powered by a racket of anti-social people, who collect thrown water bottles from railway track on stations, fill water from anywhere they like, get it sealed and pass to the IRCTC approved vendors. The vendors as well as the racket involved in this share half of the revenues. What the customer is getting? Unhygienic water in unhygienic bottles paying Rs.12. The mistake is from customer side also. As mentioned on the bottles please DO CRUSH THE BOTTLE AFTER USE IF YOU AREN"T CARRYING IT HOME. This is for your own good dear common man!
2. Tatkal Seva: Your tatkal reservation scheme is completely wtf!!! The first and foremost thing is that, at 8AM IST irctc.co.in stops responding so internet reservation is next to impossible for the stupid common man. What I see is 503 SERVICE UNAVAILABLE. Now, you railway guys would say that you can get the reservation on the station. Ok, I agree. But see what happens. When I reach the station at 7:00 AM and stand in the queue, I see at least 20 people ahead of me. I repeated the same experiment next day at 6:00AM. Then too I had at least 15 people ahead of me. So, I thought let me be a good citizen and wait for my turn. Finally I reached to the front of the queue at about 8:10 and the teller told me the status is W/L 60. What the -? A man roaming like a pig in the vicinity came to me and offered the ticket for Rs.1200. I identified him and was surprised that he was in the queue when I had reached there at 6AM. I refused and headed towards exit without getting a ticket. During the next 20 meters of walking I was offered ticket for prices ranging from Rs.900 to Rs.1200. And they were all those who were in the queue at 6AM. To sum up, there is a racket which keeps its agents at stations from time varying between 4AM and 6AM to be in the queue for tatakal tickets for most sought for destinations. How can you control this blackmarketing?? Can't you get your IRCTC server right, so that people may get tatkal e-tickets? And then it will be very difficult to black e-tickets because the traveller has to present his/her ID card with name matching with the name on the e-ticket and reservation chart. This step will put a check on those ticket blackmarketer rackets. All the crap in your tatkal seva is especially frustrating students and other people who get to travel urgently very often.
3. Recently you've introduced the fares in front of each train in the list of trains that come up when anyone queries for Availability of seats(in case you don't know station codes) on indianrailways.gov.in. One suggestion from me, can't you show the availability as well along with the fair? If you can't, then freaking upgrade your servers and start doing right away you public money looters!!!
4. On indianrail.gov.in, any action I perform, even clicking a text box to put the cursor into it, results into opening up of an ad from admagnet.com. Have you designed the site for public convenience or public harassment??? You earn from our ticket fares and you the greedy lot want to earn more and more by giving us inconvenience in the form of those nasty popups??? And who the freaking fool gave you WebRatna-2009 award for public service? 'sab ek hee thaili ke chatte batte hain'. Cut this crap in good faith right away!!!
5. This is for Mrs. Mamta Banerjee, honourable Rail Minister. Lalu uncle did only one good reform during his tenure, and that was putting up a middle berth between side upper and side lower berths in sleeper class. It was itching you at the back, and you got all those removed saying that this causes inconvenience to passengers. Have you ever travelled in sleeper class? The people in the waiting list travel by sleeping in front of lavatory doors and in the space between the entry gates of every boggy. Thats not inconvenience according to you. Right? And sleeping on the side middle berth is inconvenience according to you. Very good IQ you have ma'm! Salutes to you! If there had been this, side middle berth thingy, per boggy 8 passengers and per train more than 100 waitlisted passengers would get a confirmed berth to sleep in the night, instead of laying their bedsheets below water basin between the two gates in every boggy.
6. This mobile charging point thing, at the gates of every boggy in sleeper class has become a menace. Rogues only charge their mobiles. They start the travel with their mobile's batteries discharged thinking 'Bhartiya rail hamari sampatti hai'. This is total inconvenience to the needy passengers who don't want to talk to those rogues. Can't you get those charging points in every compartment, just like they are in AC boggies?
7. This one is for Amul. Have you guys ever thought that why Pepsi/Coke/Thumsup/Sprite sell 100 times more than your lassi, in trains even though your lassi is tastier and nourisher than those MNC carbonated water? Give a thought! Lower your prices. You are selling them at Rs.20 for 200ml. They sell for Rs.10 for 200ml. Can't you lower your prices? Don't say that it won't be affordable for you. Nandini lassi in Karnataka is available for Rs.5 for 200ml. Instead of trying to earn more by higher margins per unit, you should keep lower margins and sell more units instead. This will give you better returns. I hate those cola companies who are drawing Indian water and selling to Indians for high prices.
I'll keep coming up with more whenever I feel like finding something new with Railways.
I, on behalf of student community, and as a proud and aware citizen of India, want to draw the attention of proper and competent authorities towards the fraud and corruption looming large in IRCTC catered service which is leading to the plight of passengers, especially those travelling in Sleeper Class. I'm also incorporating some suggestions, which if implemented will result in better customer satisfaction.
1. Water: As far as I know, it was made mandatory that IRCTC would sell only Rail Neer branded mineral water bottles in the train. May be I'm wrong about this fact, I've experienced personally that the water/drink vendors are selling all brand waters except Rail Neer. I ask for Rail Neer and they say, it's not available, take Bailey or IceLing or Yes. I won't mind if the quality of water is good for the same price of Rs.12. But, the striking thing I saw that those small kids, powered by a racket of anti-social people, who collect thrown water bottles from railway track on stations, fill water from anywhere they like, get it sealed and pass to the IRCTC approved vendors. The vendors as well as the racket involved in this share half of the revenues. What the customer is getting? Unhygienic water in unhygienic bottles paying Rs.12. The mistake is from customer side also. As mentioned on the bottles please DO CRUSH THE BOTTLE AFTER USE IF YOU AREN"T CARRYING IT HOME. This is for your own good dear common man!
2. Tatkal Seva: Your tatkal reservation scheme is completely wtf!!! The first and foremost thing is that, at 8AM IST irctc.co.in stops responding so internet reservation is next to impossible for the stupid common man. What I see is 503 SERVICE UNAVAILABLE. Now, you railway guys would say that you can get the reservation on the station. Ok, I agree. But see what happens. When I reach the station at 7:00 AM and stand in the queue, I see at least 20 people ahead of me. I repeated the same experiment next day at 6:00AM. Then too I had at least 15 people ahead of me. So, I thought let me be a good citizen and wait for my turn. Finally I reached to the front of the queue at about 8:10 and the teller told me the status is W/L 60. What the -? A man roaming like a pig in the vicinity came to me and offered the ticket for Rs.1200. I identified him and was surprised that he was in the queue when I had reached there at 6AM. I refused and headed towards exit without getting a ticket. During the next 20 meters of walking I was offered ticket for prices ranging from Rs.900 to Rs.1200. And they were all those who were in the queue at 6AM. To sum up, there is a racket which keeps its agents at stations from time varying between 4AM and 6AM to be in the queue for tatakal tickets for most sought for destinations. How can you control this blackmarketing?? Can't you get your IRCTC server right, so that people may get tatkal e-tickets? And then it will be very difficult to black e-tickets because the traveller has to present his/her ID card with name matching with the name on the e-ticket and reservation chart. This step will put a check on those ticket blackmarketer rackets. All the crap in your tatkal seva is especially frustrating students and other people who get to travel urgently very often.
3. Recently you've introduced the fares in front of each train in the list of trains that come up when anyone queries for Availability of seats(in case you don't know station codes) on indianrailways.gov.in. One suggestion from me, can't you show the availability as well along with the fair? If you can't, then freaking upgrade your servers and start doing right away you public money looters!!!
4. On indianrail.gov.in, any action I perform, even clicking a text box to put the cursor into it, results into opening up of an ad from admagnet.com. Have you designed the site for public convenience or public harassment??? You earn from our ticket fares and you the greedy lot want to earn more and more by giving us inconvenience in the form of those nasty popups??? And who the freaking fool gave you WebRatna-2009 award for public service? 'sab ek hee thaili ke chatte batte hain'. Cut this crap in good faith right away!!!
5. This is for Mrs. Mamta Banerjee, honourable Rail Minister. Lalu uncle did only one good reform during his tenure, and that was putting up a middle berth between side upper and side lower berths in sleeper class. It was itching you at the back, and you got all those removed saying that this causes inconvenience to passengers. Have you ever travelled in sleeper class? The people in the waiting list travel by sleeping in front of lavatory doors and in the space between the entry gates of every boggy. Thats not inconvenience according to you. Right? And sleeping on the side middle berth is inconvenience according to you. Very good IQ you have ma'm! Salutes to you! If there had been this, side middle berth thingy, per boggy 8 passengers and per train more than 100 waitlisted passengers would get a confirmed berth to sleep in the night, instead of laying their bedsheets below water basin between the two gates in every boggy.
6. This mobile charging point thing, at the gates of every boggy in sleeper class has become a menace. Rogues only charge their mobiles. They start the travel with their mobile's batteries discharged thinking 'Bhartiya rail hamari sampatti hai'. This is total inconvenience to the needy passengers who don't want to talk to those rogues. Can't you get those charging points in every compartment, just like they are in AC boggies?
7. This one is for Amul. Have you guys ever thought that why Pepsi/Coke/Thumsup/Sprite sell 100 times more than your lassi, in trains even though your lassi is tastier and nourisher than those MNC carbonated water? Give a thought! Lower your prices. You are selling them at Rs.20 for 200ml. They sell for Rs.10 for 200ml. Can't you lower your prices? Don't say that it won't be affordable for you. Nandini lassi in Karnataka is available for Rs.5 for 200ml. Instead of trying to earn more by higher margins per unit, you should keep lower margins and sell more units instead. This will give you better returns. I hate those cola companies who are drawing Indian water and selling to Indians for high prices.
I'll keep coming up with more whenever I feel like finding something new with Railways.
Labels:
Government,
My Life
Wednesday, May 19, 2010
How to use <conio.h> with GCC
This article will teach you how to use <conio.h> header file while programming in C under linux environment with GCC, and getting unbuffered input from the user.
Most of the students are taught C/C++ with Turbo C/C++ IDE in schools. Turbo C has a header file(unspecified in ANSI standard) <conio.h> with which programmer can program for unbuffered input using functions like getch(). Also there are other functions like gotoxy() etc. which work perfect in DOS environment with Turbo C.
After they learn about linux, and then GCC they start practicing in linux. If you are such an student, read on. This will be handy for you.
At some point of time you will write a program in which you want interactive user input from the user. Interactive in the sense that you want an action to be performed as soon as a key is pressed. But since standard library function getchar() buffers the input until ENTER key is pressed, it will be quite irritating for you. So, you'll miss your <conio.h> header file that you used in Turbo. Don't worry. I faced the same problem and I ran around like everything to find a soluion. And finally, I found a solution!!!
Solution
Just download the libconioh from this link
Install it. Here are the steps(I'm considering Ubuntu as the example):
1. Copy the downloaded archive to your home folder
2. Open the terminal, by pressing Alt+F2 and typing xterm and pressing enter.
3. Become root by typing
4. Type
5. Now enter into the extracted directory by typing
6. Install the library by typing these commands one after another's execution.
Just #include <conio.h> in your program. And when compiling your program(eg. myprogram.c in current working directory) using gcc give the library's detail to the linker like this:
Execute it and enjoy!
Here is a sample program that reads characters from the keyboard, displays the character just next to it(for example, if u enter b it will display c) and exits only when you press the small a key.
Most of the students are taught C/C++ with Turbo C/C++ IDE in schools. Turbo C has a header file(unspecified in ANSI standard) <conio.h> with which programmer can program for unbuffered input using functions like getch(). Also there are other functions like gotoxy() etc. which work perfect in DOS environment with Turbo C.
After they learn about linux, and then GCC they start practicing in linux. If you are such an student, read on. This will be handy for you.
At some point of time you will write a program in which you want interactive user input from the user. Interactive in the sense that you want an action to be performed as soon as a key is pressed. But since standard library function getchar() buffers the input until ENTER key is pressed, it will be quite irritating for you. So, you'll miss your <conio.h> header file that you used in Turbo. Don't worry. I faced the same problem and I ran around like everything to find a soluion. And finally, I found a solution!!!
Solution
Just download the libconioh from this link
Install it. Here are the steps(I'm considering Ubuntu as the example):
1. Copy the downloaded archive to your home folder
2. Open the terminal, by pressing Alt+F2 and typing xterm and pressing enter.
3. Become root by typing
sudo -sand supplying your password.
4. Type
tar -zxvf libconio-1.0.0.tar.gzand press enter to extract the archive. To make the typing easy you may press the <tab> key on your keyboard after typing l of libconio-1.0.0.tar.gz for autocompletion of filename.
5. Now enter into the extracted directory by typing
cd libconio-1.0.0and pressing enter.
6. Install the library by typing these commands one after another's execution.
./configure
make
make installNow the library has been installed. How to use it for programming?
Just #include <conio.h> in your program. And when compiling your program(eg. myprogram.c in current working directory) using gcc give the library's detail to the linker like this:
gcc myprogram.c -lconioYou will get the a.out file if your program doesn't have any errors.
Execute it and enjoy!
./a.outBut what did that -lconio did? See, in gcc the source files and object library files can be linked by specifying them back to back. Like:
gcc file1.c file2.c lib1.a lib2.aIn linux the library files are with .a extension and they are stored in /usr/lib/ directory with the name format lib<library_name>.a . So when you installed libconioh it copied a file, named libconio.la to the /usr/lib directory. Now you can compile and link your program that uses conio.h by this command
gcc myprogram.c /usr/lib/libconio.aThe -l switch has been provided as a shortcut for your convenience. This -l makes conio to be read as /usr/lib/libconio.a hence when yo typed gcc myprogram.c -lconio it was interpreted as gcc myprogram.c /usr/lib/libconio.a . Now thats sweet! Isn't it?
Here is a sample program that reads characters from the keyboard, displays the character just next to it(for example, if u enter b it will display c) and exits only when you press the small a key.
#include <conio.h>
int main(){
char c;
while((c=getch())!='a'){
putchar(c+1);
}
putchar('\n');
return 0;
}
Labels:
Assignments,
Programming,
Study
Subscribe to:
Posts (Atom)