It’s a Panda’s Life

I believed I had this beautiful set of numbers. Then reality struck and they weren't actually there. On one hand, having fake but nice numbers is bad, on the other hand, those numbers were really pretty. And now I sit around reading and thinking about Haskell and hating on C++. Who would have known that j would differ in

 
  std::vector<int> something[numelts];
  something[7].push_back(2);
  int j = something[7][0];
 

and

 
  std::vector<int> something[numelts];
  something[7].push_back(2);
  int j = (something[7])[0];
 

.
The later is correct, the first is wrong, C++ seems to be treating unparenthisized things as normal array lookups, while the parenthisized thing leads to it using operator[] from vector.

panda

§293 · September 22, 2007 · CS, Hacks · 11 comments ·


When I was at EA, me and Eddie once had a debate about why I thought Aston Martin’s were cool. Now neither of us could really afford one of those, it was more of an academic debate, with him arguing that mass produced cars were more likely to be safer and have better designed engines. [...]

Read more...

§291 · September 18, 2007 · article · 14 comments ·


This semester as a part of TAing 167/9 we are making use of Mercurial for SCM. Itay liked Hg so much that he actually started using it for nearly everything on his computer and came up with a good reason for doing this. I am not organized enough to put all of my files into [...]

Read more...

§290 · September 11, 2007 · CS, systems · 135 comments ·