Thought For The Day

“Mistakes are the portals of discovery.”
James Joyce

 

 

Traveling Overseas for Work? 5 Tips for International Business Travel

If you’ve been asked to travel internationally for work, you’re probably excited by the opportunity but could benefit from some tips on making the journey a stress-free one.  To that end, we’ve compiled some suggestions so your next international work trip goes smoothly:

  1. Check the US Department of State website before you depart for your destination.  The site provides travel warnings and alerts to US citizens traveling internationally, allowing people to quickly see if there are any terrorist activities, demonstrations, health outbreaks, civil unrests, etc. in the area they’ll be visiting.

  2. Read up on local customs so you don’t end up in a situation where you inadvertently offend a foreign business associate.  For example, sprinkling salt on your food is considered offensive in Egypt.  If you’re invited to someone’s home in Venezuela for a meal, avoid showing up on time, or worse still, early.  Guests are seen as overeager--or even greedy--when they show up at the appointed time!

  3. Purchase the right voltage adapter.  Some adapters are designed for items that are high-wattage, like hair dryers or irons, whereas other adapters may be safe to use with electronics but NOT okay with a hair dryer.  Do a little research before you leave home to determine exactly what you need.

  4. Learn some basic phrases you can use in the country you’ll be visiting.  While your business associates won’t expect you to be fluent in their language, they will appreciate it if you familiarize yourself with some basic words and phrases.

  5. Find out how much your cellular carrier charges for international calls/data so you’re not caught by surprise.  At a minimum, you’ll probably want to turn off your phone’s international data roaming capability and use an app like Skype or WhatsApp to speak to loved ones at home.  

What Is the Most Irritating Thing You Can Do in a Meeting?

Have you ever wondered if your meeting behavior is up to par?  To determine which behaviors are best to be avoided at all costs, we looked to Quora contributors to answer the question, “What is the most aggravating thing people can do in a meeting?”  Here are some of our favorite responses:

“The most aggravating thing to me is when all members of the meeting laugh really LOUD at things that are barely whimsical at best.  It’s like there is some kind of competition where people (especially sales) use all of their lung capacity to appear really important by being the loudest laugher.”

“Have you ever witnessed a United States President pausing while giving a State of the Union address to check his Blackberry?  Probably not.  Chances are, any messages coming in to him are more important than the messages you might receive.  Unless you are the designated meeting note-taker, there is no acceptable reason to even glance at an electronic device during a meeting.”

“Touchy feely bonding as a topic for a meeting.  I work here, I have a job to do, and I do not want to have a meeting so we can eat and have nonsensical small talk.  If some folks want to meet up after work, go for it but don't act like it’s vital everyone goes.  Having a personal bond is not necessary for professionals to be successful and if it does happen, it should happen organically.”

“It's a personal pet peeve but showing up late drives me up a wall.  It's an unfortunate reality of business that meetings must happen...but it's highly disrespectful of people's time to be late when there is so much work to do.”

The Biggest Social Media Blunders in 2015

While companies are improving at social media, they still make mistakes from time to time.  Below we present some of the biggest gaffes of 2015, as compiled by ClickZ.

  • Starbucks Oversteps Its Bounds.  Starbucks CEO Howard Schultz suggested that the company should play a role in ending racism.  To this end, baristas were instructed to write “Race Together” on coffee cups.  Rather than inspiring the heartfelt conversations about race that Schultz hoped for, the initiative was met with widespread scorn and the campaign was quickly pulled.

  • SeaWorld Takes Questions…SeaWorld has received a lot of negative press since the release of Blackfish, a documentary about the problems experienced by orcas in captivity.  In an effort to restore the company’s image, SeaWorld created the hashtag #AskSeaWorld to answer questions that people had about whale care.  Rather than responding to queries like, “How many pounds of fish do whales eat a day?”  Sea World was forced to play defense when people sent questions like, “Why do you provide more area for us to park our cars than you give these animals to live?”

  • Blackberry’s Big Blunder.  In January, the company tweeted a photo of a sleek smartphone.  Unfortunately for Blackberry, reporters quickly discovered that the photo was not of a Blackberry and was actually an iPhone.  Whoops.

  • Twizzler’s Autism Fail.  Wanting to capitalize on the success of the Ice Bucket Challenge, Twizzler’s developed its own challenge to raise funds for autism.  The company encouraged people to eat Twizzlers Lady and the Tramp-style from opposite ends.  Unfortunately, nobody cared about the challenge, and today, you can’t even find out how much money it raised.

  • SuperGurl Gets Super Offensive.  Retailer SuperGurl changed its “Shop Now” button to “Rape Us Now” on Black Friday.  As outrage ensued, the company issued a weak apology and sent out a number of generic responses to people who wrote in to complain.  While this may have been a publicity stunt, deliberately offending your consumer base is always a huge misstep.   

Object-Oriented Programming: Operator Overloading - Indexing Operator

One of many useful applications of operator overloading in C++ is the indexing operator [].  Since indexing and accessing elements of arrays are such common operations, we can make them less complicated in some cases by overloading the indexing operator.  This is often used in situations where an array is a class member.

Let's see an example:

class Array
{
private:
    int *ptr;
    int size;

public:
    ...
    
    int& operator[] (int index)
    {
        if (index >= size)
        {
          cout << "Array index out of bound!";
          exit(0);
        }
        return ptr[index];
    }
};

 

This overload enables us to do several things: first, we can access the elements of our array easily.  Further, we have incorporated into the operator function the mechanism of checking whether the array index is out of bounds.  Finally, notice how the return type of the function is not int, but int&.  We did this because usually, you would like to assign a value to ptr[index].  Since you can only assign values to so-called lvalues, and references are by definition lvalues, we are returning a reference.

Now we have covered some basic groups of operators, and we saw how they are overloaded.  Something that would be useful now would be writing our entire Complex class in one place, with everything we've covered so far - constructors, copy constructors, overloaded assignment operator etc.  Then we will actually have a complete, functional class written in a way which respects object-oriented principles.

Another thing we haven't mentioned so far, and is a common practice in C++, is separating class interface from the actual implementation.  This is achieved by writing only the method headers in one file (usually with a ".h" extension), and making another file in which we will include the header file.  Method definitions will be written in this other file.

ComplexHeader.h

#include <iostream>

class Complex
{
private:
    double re, im;

public:
    Complex() {}
    Complex(double, double);
    Complex(const Complex&); //since we don't have any dynamic memory handling in our class, 
                             //we don't actually need the copy constructor; automatic (shallow) copying would be enough;
                             //same thing for assignment operator and destructor;
    Complex& operator=(const Complex&);
    Complex operator++();
    Complex operator++(int);
    friend Complex operator+(const Complex&, const Complex&);
    ~Complex(){}
};

------------------------------------------------------------------------------------------------------------------------------

Complex.cpp

#include "ComplexHeader.h"

/*Complex:: - scope resolution*/

Complex::Complex(double rr, double ii) : re(rr), im(ii) {}
Complex::Complex(const Complex& rhs)
{
    this->re = rhs.re;
    this->im = rhs.im;
}
Complex& Complex::operator=(const Complex& rhs) 
{
    re = rhs.re;
    im = rhs.im;
    return *this;
}
Complex Complex::operator++()
{
    ++re;
    ++im;
    return *this;
}
Complex Complex::operator++(int dummy)
{
    Complex w(re, im);
    ++re; ++im;
    return w;
}
Complex operator+(const Complex& z1, const Complex& z2)
{
    Complex w;
    w.re = z1.re + z2.re;
    w.im = z1.im + z2.im;
    return w;
}
Now, we can test the program by writing another .cpp file with a main() function.
MainProgram.cpp

#include "ComplexHeader.h"

int main()
{
    Complex c1(1.0, 2.5), c2(2.0, 3.2);
    ++c2;
    Complex res = c1 + c2;
    std::cout << res.im; //private member - can't be accessed! 
    return 0;
}

We encourage the reader to write a getter function for re and im class members, and in one of the following articles we will learn how to handle situations like this by overloading the << operator.

Project with error: http://goo.gl/vlwcdt