1.04.2005

On this Page

» Random Late Night Jokes
» Random Late Night Jokes
» Q&A: how to make it work with << and >>...
» RANT: Overheard on the Bus
» Q&A: what if the assignment operator is implemented...
» Q&A: what if the following member function...
» RANT: What is...
» Q&A: What's buggy about the given Instrument class below?
» Random Quotes
» RANT: What is a Quant? II

Random Late Night Jokes

Subway crime in New York City is on the rise because a lot of people are stealing iPods. They just steal them off people when they're riding the subway. That's terrible! Imagine people stealing music from people who stole music.

  • the bride that everyone thought had been kidnapped just got cold feet and took off... Today the fiancĂ© said he still wants to get married! Somebody needs to tell this guy there are plenty of other crazy women out there.
  • Due to the price of gasoline Dominos Pizza is now charging a $1.00 fee for their deliveries. Don't worry though - your pizza will still arrive piping cold!

Category: C++ Quant > Random Walk

Your Turn!

 

Random Late Night Jokes

The 212-year-old New York Stock Exchange is merging with an all-electronic company so it will become high speed with faster trades. This way, instead of waiting hours, you'll be able to lose their money within seconds.

  • I was reading about our new pope. The new pope, Pope Benedict the 16th said that he prayed he would not get elected. And today Hillary called the Pope and said, "Hey can you pray for me in 2008?"
  • Newly elected Pope Benedict XVI said on Monday that he had prayed to God that he would not be elected. The new pope then went on to emphasize the power of prayer.
  • According to a new poll, 7 out of 10 Americans say the tax code is too complicated. Well duh, that's why they call it a code. They don't want you to understand it. That's the whole idea.

Category: C++ Quant > Random Walk

Your Turn!

 

Q&A: how to make it work with << and >>...

... given this Instrument class?

class Instrument {
private:
  ...
  friend ostream& operator<<(ostream&, const Instrument&);
   ...
}

ostream& operator<<(ostream& s, const Instrument& i)
{
  s << i.description;
  return s;
}

Category: C++ Quant > C++

Your Turn!

 

RANT: Overheard on the Bus

*First day on the job*: ...I felt completely like a fish out of water 'cos the topic was Finance, not systems or IT which had been my life the last decade and knew like the front & back of my hand... I guess I need to be patient with myself and allow myself to ride the learning curve. I just am not comfortable at this point, not knowing the ins and outs of their game... This is totally right brain domination vs. the previous life's left brain drill--so foreign, frightening, yet exciting... Probably gonna take 3-6 mos. before the learning curve flattens out though.

Exit Interview: ...I was proud of myself for not flying off the handle at the meeting and I was happy I didn't do anything to burn any bridges... I wondered why they never came to me to ask 'my side of the story'...it is surely because they wanted me out and they were tryin to pin something on me, something I am not guilty of... It was like trying to fight City Hall, I realized I couldn't win, I was defending myself, but no one wanted to listen...

Asking for a raise: ...I think you need to figure out, maybe by asking her, if her remarks are just her personal opinion or her professional opinion based on the value you bring to the company, or the current salary budget... even if your manager is supportive, you need to know which way the wind is blowing above her... No matter how rosey she said it is for her, the top may not be supportive... don't bluff, but if you have an offer, it's a bargaining chip... You're playing Russian roulette with five loaded cylinders...

Category: C++ Quant > Random Walk

Your Turn!

 

Q&A: what if the assignment operator is implemented...

...as the following in the Instrument class?

class Instrument {
public:
  ...
  Instrument& operator=(const Instrument& rhs);
   ...
}

Instrument& Instrument::operator=(const Instrument& rhs) {
  delete [] description;
  description =   new char[strlen(rhs.description) + 1];
  strcpy(description, rhs.description);
  return *this;      
}

guess what happen when one tries the following

Instrument c("another bond");
c = c; 

Category: C++ Quant > C++

Your Turn!

 

Q&A: what if the following member function...

...is defined for the Instrument class?

class Instrument {
public:
  ...
  void doNothing(Instrument instr) {}
   ...
}

Default copy constructor doesn't work for dynamically allocated memory.

Instrument c("another bond");
a.doNothing(c);

Category: C++ Quant > C++

Your Turn!

 

RANT: What is...

What is Blackberry?
  • a tool that blurs the boundary between work and home, creating more freedom for you (working from anywhere) and your boss (reaching you at anytime)
  • a major status symbol. If your company gives you one, you must be one of the superstars.
  • a tool that's intrusive and creates 24/7 corporate slaves.

What is H1-B?

  • a tool developed by the government to stop firms from paying idiots too much, like $500/hr for a principal Consultant with 3 years of exp.

What is Blog?

  • a tool that enables a prospective employer to Google you and read all about your bad hair days, how you really felt about your last boss and much more, all at the click of a mouse.

Category: C++ Quant > Random Walk

Your Turn!

 

Q&A: What's buggy about the given Instrument class below?

class Instrument {
public:
  Instrument(const char *desc);
  ~Instrument();
private:
  char *description;
};
 
Instrument::Instrument(const char *desc) {
  if (desc) {
    description = new char[strlen(desc) + 1];
    strcpy(description, desc);
  }
  else {
    description = new char[1];
    *description = '\0';
  }
}

inline Instrument::~Instrument() { delete [] description; }

Default assignment operator doesn't work for dynamically allocated memory.

 Instrument a("a 14.00%, 17.50 year bond bought at $950.00");
 Instrument b("a 14.00%, 18 year bond bought at $1000.00");
 b = a;

  • the memory that b used to point to was never deleted
  • both a and b now contain pointers to the same character string. When one of them goes out of scope, its destructor will delete the memory still pointed to by the other.

Category: C++ Quant > C++

Your Turn!

 

Random Quotes

  • The elevator to success is out of order. You'll have to use the stairs... one step at a time." - Joe Girard
  • I gave my wife a new watch for her birthday . . . waterproof, shockproof, unbreakable and anti-magnetic. Absolutely nothing could happen to it. She lost it. - Joey Adams
  • One should forgive one's enemies, but not before they are hanged.
  • Always remember that you are absolutely unique. Just like everyone else.
  • I learned the value of hard work by working hard.
  • Life in the twentieth century is like a parachute jump: you have to get it right the first time.
  • The enemy you know is not as bad as the enemy you don't know - Russian proverb

Category: C++ Quant > Random Walk

Your Turn!

 

RANT: What is a Quant? II

When people I meet at parties ask me what I do for a living, I tell them proudly (most of the time anyway), "I'm an Quantitative Analyst." In a heartbeat, they get that blank look on their face, "Ohhh. And what exactly is that?"

I don't know how one supposed to explain Quantitative Analysis in a short, concise manner, but I usually say something like "...through advanced mathematical and programmnig techniques, we try to model, analyze, and predict the markets...", most of the time it still leaves the person clueless.

Then I decide to try a different approach. I start the response with a joke: When Harry Truman and Tom Dewey faced off in the 1948 presidential elections, Dewey went to bed convinced he was the next president of the United States. He said to his wife, "Dear, tonight you'll be sleeping with the President of the United States." But when he awoke, he learned that Harry Truman had won. Mrs. Dewey said to her husband, "Tom, will I be going to Washington or is Mr. Truman coming here?"

I then continue: Mr Dewey analyzes and predicts elections, I analyze and predict the market. That tends to help me get past the blank look.

Category: C++ Quant > Random Walk

Your Turn!