Skip to main content

Posts

WHY I STARTED.......

I never wanted to read books. I almost hated reading anything. I though glanced at the morning newspaper for the important news and all. There was a good friend of mine who suggested me to read the Five Point Someone by Chetan Bhagat. I read that book in 1 day, followed that with his second book, "One night @ the call centre". The books made me a fan of Chetan. I started reading books. Recently I started writing blogs. The way it turned my life is unimaginable. This website is one of the amazing things I've ever seen which is a product of a student. I know my blog have received mixed reactions but I want to end this post by these words ,"Every week 200 new visitors visit my blog, out of them 150 don't read my blog, 20 hate my blog, 20 would not visit my blog again, 10 love my blog and I write for those 10" PS: This post is very close to my heart PS: I would love if you leave a comment. PS: B.T.W I've an exam 2 month from now, yes I'm blog

FOR MY BLOG READER'S

It is not for me but for my readers. 'One' resolution fROM taday: I want to look like Aamir khan (without 8 packs) Bike or Car (and why): Car, I’ve three reasons for it 1. It’s safer than bike 2. I’ve always dreamt of going on a long drive with my soul-mate in a car. 3. While driving a car you can look into the eyes of.......... obviously you can guess?? J A chance to fly or a chance to be invisible (and why): Invisible, I suffer from Acrophobia (an extreme or irrational fear of heights). I would love to love: My parents, they deserve my love more than anyone in this world. Most recent Dream I had: I’m a kid again. Teacher in the school asks to describe a word and I was struggling L If I were to marry today, I would: If the girl is pretty, I would be delighted. If the girl is not so ..., I wouldn’t marry and convince everybody that I’m underage (I’m actually 20 years old). My Dream Girl is/would be: SHEEEE Best F

THE LUCK FACTOR

In Chinese philosophy we believe that there are three types of luck that influence our life: Heaven luck– our astrology: the planetary alignment at our time of our birth and how that shapes our life. And the family we are born into and how they nurture and influence us. Human luck- our attitude towards life, our motivation and drive and the effort we put into developing our future. Earth luck– the energy of our environment and the impact that has on our life. Earth luck is feng shui. Remember we all have control over our human luck and our earth luck, therefore, 66% of our luck is in our control. The Four Principles by Professor Richard Wiseman Professor Wiseman has identified the four basic principles that lucky people use to create good fortune in their lives. Principle One: Maximise Chance Opportunities Lucky people are skilled at creating, noticing and acting upon chance opportunities. They do this in various ways, including networking, adopting a relaxed attitude

Problems Related to Class and Inheritance

Problem #1: This program contains some error(s), can you spot which line(s) contains error(s)? 1 // Problems No.1 2 // Related to Inheritance 3 #include 4 5 // base class 6 class base 7 { 8 int a; 9 10 public: 11 void seta(int num){a=num;} 12 }; 13 14 // derived class 15 class derived:public base 16 { 17 int b; 18 19 public: 20 void setb(int num){b=num;} 21 22 void show() 23 { 24 cout< 4 5 // base class 6 class base 7 { 8 protected: 9 int a; 10 11 public: 12 void seta(int num){a=num;} 13 }; 14 15 // derived class 16 class derived:protected base 17 { 18 protected: 19 int b; 20 21 public: 22 void setb(int num){b=num;} 23 void show() 24 { 25 cout< 4 5 // base class (1) 6 class

Inline Functions and their Uses

It’s a good practice to divide the program into several functions such that parts of the program don’t get repeated a lot and to make the code easily understandable. We all know that calling and returning from a function generates some overhead. The overhead is sometimes to such an extent that it makes significant effect on the overall speed of certain complex and function-oriented programs. In most cases, we have only a few functions that have extensive use and make significant impact on the performance of the whole program. Not using functions is not an option, using function-like macros is an option, but there is a better solution, to use Inline Functions. Yes, like it sounds, inline functions are expanded at the place of calling rather than being “really called” thus reducing the overhead. It means wherever we call an inline function, compiler will expand the code there and no actual calling will be done. Member functions of classes are generally made inline as in many case

ER diagram

1. Prepare an E-R diagram for a real estate firm that lists property for sale. The following describes the organization: • The firm has a number of sales offices in several states. • Each sales office is assigned one or more employees. An employee must be assigned to only one sales office. • For each sales office, there is always one employee assigned to manage that office. An employee may manage only one sales office to which he/she is assigned. • The firm (sales office) lists property for sale. • Each unit of property must be listed with one (and only one) of the sales offices. A sales office may have any number of properties listed, or may have no properties listed. • Each unit of property has one or more owners. An owner may have one or more units of property.

Templates

TEMPLATES C++ gives us the facility to write a common function that is independent of the data type but which embodies the common set of instruction which could be applied on any data type. This has some advantages, like ease of code development and code maintenance. This could be accomplished with the help of templates. Inside the templates we can have some or all data types unspecified. (Any data type is accepted.) Templates could be created for individual function or a class. Template function is called generic function and class is called generic class. GENERIC FUNCTION The syntax for creating a template for generic function is as follows: Template Return_type function_name (T arg1, T arg2, T arg3……….) { // function statements } It should begin with the keyword template. Ttype is the placeholder name for a data type used by th function. Prog1: #include template void swapdata(X & a, X & b) { X temp; t