Posts tagged ‘work’

## C++ is bad: problems with the ternary operator

In today’s installment of “why not to program in C++,” I give you the following quiz, which Dustin, Steve, Tom, and I had to figure out today (Dustin’s code was doing the weirdest things, and we eventually traced it down to this):

Suppose you start out with the following code:

class Argument;
Argument x;
void Foo(const Argument& arg);
bool test;

You can assume that all of these are defined/initialized elsewhere in the code. For each pair of code snippets below, decide whether the two snippets are equivalent to each other.

# Code Snippet
A
Code Snippet
B
1
if (test) Foo(x);
else Foo(Argument());
Foo(test ? x : Argument());

2
{ // limit the scope of y
Argument y;
Foo(test ? x : y);
}
Foo(test ? x : Argument());


3
Foo(x);
Foo(test ? x : x);
4
Foo(x);
Foo(true ? x : Argument());

Edit: what I meant by the curly braces in Question 2 is that you shouldn’t consider “y is now a defined variable” to be a significant difference between the two snippets.

## OH, HAI! ICANN HAS NEW RULEZ PLZ?

Hells yeah! The Internet Corporation for Assigned Names and Numbers, the group in charge of domain registrars (who are in charge of keeping track of who owns what domain names) changed some boring policies, and my personal work indirectly affected the entire Internet. →

## Industreality

I’m now up in northern California for a week of orientation before I start my real job. The hotel I’m in is amazingly swanky—in my room I have a Rubik’s Cube, a deck of cards, a yoyo, and an etch-a-sketch, not to mention a bowl of cherries, a couch, and some other fancy stuff. The main office here really is as amazing as most of the stories make it seem. I unfortunately am not allowed say much of anything about what I’ll be doing or what it’s like to be in the company, what with their culture of secrecy and all. My first day wasn’t exactly like the way dhalps got his security clearance for his internship in Washington, but it was similar enough to conjure up a comparison. Suffice it to say, there’s a lot of new and exciting stuff for me to learn, but unless something really unusual happens, I’m not going to comment about work much more here. Sorry!

## Seymour’s my friend

\begin{LittleShopOfHorrors}
Someone show me a way to get outa here,
‘Cause I constantly pray I’ll get outa here
Please, won’t somebody say I’ll get outa here
Someone gimme my shot or I’ll rot here.

I’ll do I dunno what to get outa [Mudd]
But a hell of a lot to get outa [Mudd]
People tell me there’s not a way outa [Mudd]
But believe me I gotta get outa [Mudd now!]
\end{LittleShopOfHorrors}

I’m pulling my third all-nighter of the week (well, not quite – I’ve gotten at least an hour of sleep every day), and I don’t expect to have less work until Wednesday afternoon, when I will only have a 15-minute presentation and a 20-page paper left to do. I am so ready to graduate right now!

However, the Big Algorithms presentation on Tuesday went just about perfectly (Reid and I discussed pattern matching, and in particular the Knuth-Morris-Pratt and Boyer-Moore algorithms): people seemed to understand everything we covered, we answered questions well, and they asked leading questions (this was awesome – on 3 separate occasions, we answered questions with “actually, that’s covered on the next slide…”). Our timing was perfect down to about 2 minutes of the 75-minute lecture, which blew me away because we’d never actually practiced the entire thing before. Moreover, Reid (who has a speech impediment where he stops talking when he gets flustered) went through his half perfectly, without any long pauses. On the feedback forms, one person even wrote that this was the best student lecture of the entire class. \/\/00T!

Right. Back to work…

## A good day, for a change

As many of you probably know, I feel quite overwhelmed with work right about now. Today changed all of that. I was supposed to have a test in my BritLit class this morning, but I spent more time sleeping due to exhaustion last night than I had intended, and therefore less time studying. This morning rolls around and I hoped to just wing it. You know what? The test proctor never showed up, so after 20 minutes we all just wrote down the 14 lines of poetry we had to memorize, put them in a big pile, and left. How great is that!? The rest of the test has been rescheduled for Monday. Then, this afternoon in my Issues of Clinic class, the entire class was given an extension on our final papers until Monday morning. So all that’s left for this week is clinic and SciComp, which can easily fill up the rest of the week but is totally doable. O frabjous day!

Right. I’m gonna go take a nap.