Archive for March 28th, 2009

Yeah, Mac fanbois are fucking whinebags

Saturday, March 28th, 2009

Not “mac users”, nor “people who like macs better than PCs”

You know who I mean. Those fucking insipid hipster douchebags who sit in starbucks and look around to make sure everyone’s watching to see what they pull out of their stylistically distressed laptop case. Anyone who dares say “macs are just better” and yet pretends they’re a thinking person.

Well apparently there’s a microsoft ad out there featuring a (delicious little redheaded) woman with $1000 to spend on a laptop. After a couple “simulated handheld cam” trips between stores and a very well placed “I’m not cool enough for mac” comment, she picks up a dell or hp or something.

The mac club is all fumy and stompy about this.

Even the Fortune piece on it is BRIMMING OVER with “yeah but the pc she picks is crap.” and “uhm… she’s an actress, not a real person!”

It’s so poutingly self referential it’s beyond humor.

Look, I’ve got lots of machines. I’ve got 3 macs (a mini, a dual G4 and a mactop that was high-end just shy of 2 years ago.) They’re nice. I like the different “look and feel.” Though the actual ‘fingerfeel’ is something I haven’t gotten used to yet.

I also use a couple flavors of linux. Add to that XP, Vista and, yes, windows 98.

They’re all fine. (Except linux, which is still an unprofessional piece of unpolished crap and will be for at least a few more years, no matter how slick the insides are supposed to be. Hat’s off to Linus for wrangling those monkeys to get it done though.)

At my last job I had to deal with the microsoft equivalent of the mac fanfags (hint: They’re filed in the back, in with the “.net programmers”.)

Why do you people need to make a religion out of it?

Someone wiser than I said that one of the big problems with political discussion nowadays is that people are increasingly identifying with ideologies. So any discussion that departs from someone’s chosen ideology is seen as a personal attack. Quite something really. Smart comment. No idea who it was.

Well it’s the same thing. Maybe marketing people have just done a stellar job. Maybe parents should be a bit more present in their kids’ lives so they learn something about value systems and identity. I dunno. It’s all that and a whole lot else no doubt.

Get the hell over yourselves. These are products created by people to be appealing to the eye, as unappealing to the wallet as they can get away with and perform a bunch of tasks. If you really REALLY identify that tightly with your brand choice in computer (well… operating system because let’s face it, the guts are now almost precisely the same) then you’re just an asshole.

I suppose I understand though so I could almost forgive you for it.

So long as you’re not a fucking pepsi drinker.

TDD in C++. Getting warmer

Saturday, March 28th, 2009

This afternoon I punched through a major wall (a couple posts down) that was preventing me from doing what I wanted to do here. I’ve been working (at about a 33% pace, what with all the hippy taunting and such I’ve been doing. It IS Saturday Night after all.)

The goal is in sight. I may very well be able to simplify this some more. But here, WITHOUT MACRO MAGIC is the first “live use case” of my C++ unit testing framework.



class MyTestSuite : public BaseTestSuite<MyTestSuite>
{
public:
MyTestSuite(const std::string& suite_name)
:BaseTestSuite<MyTestSuite>(this,suite_name)
{
}

void test_test()
{
assertEqual("Hello World!","Hello World!");
}
protected:
virtual void register_tests()
{
register_test("test_test",&MyTestSuite::test_test);
}
};


The shell is trivial…


int main(void)
MyTestSuite newSuiteTests("NewSuiteTests");
newSuiteTests.run();
newSuiteTests.post_mortem();
return 0;
}


Yes. I’m irrational. I hate macros more than I hate GOTO. They’re cheating.

The goal, more clearly stated is to be able to create an xUnit test class with “simple as possible” method tests. C++ being C++ means you must intentionally register the methods themselves.

Yes, the register method is messier than I’d like. I could get rid of the “test_test” parameter by using RTTI but frankly, the farther I can get without opening that can of worms, the better.

Yes, the constructor is a bit messier than I’d like. Currently it’s “the easiest thing that does the trick.”

People who understand C++ will at least get why I’m doing all those things.

Now, more cleanup, more of the framework’s unit tests migrated into the new suite architecture and a few more bits of functionality.

The goal is a production-ready release on April 1, with documentation, etc.

Oh yeah, the library’s about 10k spread across 2 header files.

Human Achievement Hour (nee Earth Hour)

Saturday, March 28th, 2009

I’ve got 5.3 killowatts burning for Human Achievement Hour.

Of course, with the amount of heat that generates I have the windows open and the fans drawing all that excess heat out of my apt.

SOLVED! (was: C++ Bug. Template container wonky.)

Saturday, March 28th, 2009

WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?! WHY!?!

WHY won’t this work! WHY!?!

MONTHS this has been holding me up. It looks so damn simple!

If I replace “AtomicType” with just about anything, including std::string, it runs like a charm.

Something is wrong with the fact that it doesn’t know what AtomicType is at compile time. But that’s not a bug in the source.

MONTHS this has been holding me up.

ANYBODY!?!

*bangs head on desk*

UPDATE:w00t! Here we go: “While trying to show that it didn’t matter if I instantiated the damn thing” hmmpf…

Seriously though. I added 2 lines to main to create a Bar with an int template, then to call “foobar()” on that object.

While that worked fine and didn’t have anything to do with the problem, it DID give the compiler enough information to give me a more detailed error message (which is a g++ fail IMNSHO.)

The error it yielded was:

dependent-name ‘PretendContainer::InternalType’ is parsed as a non-type, but instantiation yields a type
scrapyard.cpp:21: note: say ‘typename PretendContainer::InternalType’ if a type is meant

Now that makes perfect sense. So changing the offending line to:

typename PretendContainer<AtomicType&gt::InternalType i;

fixes everything.

So it seems that while everything I was doing was right and legal, the compiler was experiencing a bit too much indirection to adequately intuit what I meant, so it needed the “hint” of an explicit “typename” modifier.

Makes sense, though I can’t say as I’ve ever run in to this before. It’s JUST odd enough that it’s been outside my experience. Which is pretty odd because I’ve seen (and pumped out) a LOT of c++ code in my day.

So now my night is committed to my C++ Unit Testing Library.

(and maybe some WoW)