Schadendorsement

Mayor of Crawford, TX, endorses Kerry for President.

Not a schocker — he is a democrat. Just one of those things that gives you a chuckle….

Posted in politics | Leave a comment

MSVC Bitch, Pt 2

Ok, after reading up on PIMPL, that would happen to take care of this particular complaint. However, in general, C++ tools just aren’t context-sensitive-aware enough, yet. I’d like to, on the one hand, not complete on things I haven’t included; on the other thand, be prompted to include things that I’m using but that are not included. Basic Java tools are able to do this….

Posted in tech | Leave a comment

Dave Dribin Loses Weight

Or,why you should only put pictures behind a clickthrough

(nothing wrong with Dave, per se, there’s just something slightly weird about having pictures of mostly naked people up on your screen without expecting it… especially at work.)

Congrats, Dave, I’m still in shock after seeing how much weight you’ve lost at lunch last week.

Posted in random | Leave a comment

MSVC bitch

Ok, I understand that C++ is hard to parse and so a C++ IDE can’t be as slick as, say, IntelliJ. (Yes, IntelliJ is the gold standard for language-specific programming editors. If you’re coding in java with any other IDE, you are hurting your own productivity.)

That having been said, there are some very obvious stupid things that MSVC does with its code completion that it shouldn’t. For example:

class Foo()
{
    protected:
        void setInternalState(float a, float b, float c);
    public:
        void setIterations(int i);
};

int main()
{
    Foo bar;
    bar.
}

when I type bar. and hit the completion key (Ctrl-J is the default IntelliSense ‘show members’), you should only show me .setIterations. that’s all. You’re smart enough to walk the class and tell me all the members but you’re not smart enough to realize I’m not in a context where private or protected access is allowed? Ugh. Puh-lease. I hate having to walk through an object’s internal state to find the one or two methods I need.

Posted in tech | 1 Comment

Microsoft Orwell Customer Experience Improvement Program

So, I just got back from lunch. In my systray, there is an icon bearing the microsoft office logo.

First, I hover:

it says: “Microsoft Office Customer Experience Improvement Program”

Hmm, I remember something like that popping up a couple of days ago and asking me if I wanted to send anonymous data to microsoft about how I used office so it could make them better. No, not interested. I remember saying no.

Maybe I have to disable it again, how frustrating.

I single click it. Up pops one of those cartoon word-bubbles:

[i] Help Make Office Better! [X]
Want to learn about how you can improve the features you
use? click here to learn how…

Ok, that’s stupid. i double click it. Nothing.

I click the icon, then click in the bubble. Nothing.

I cannot get this fucking thing to go away. Still. It’s sitting there taunting me, driving me nuts.

Fucking god damn fuck. Google finds all kinds of information about it, but not what the process name is if I want to kill the goddamn thing…. Ergh. What a bunch of shit.

[Update: I just killed outlook and it went away. Hmm. Stupid crap...]

[Update 2: After restarting outlook and taking a crap, I came back to my desk to find the icon there again. This time clicking on it brought up the app and I was able to tell it -- again -- that I did not want it. I wonder if the last popup came from Excel and this from Outlook. Perhaps the different apps should share settings....]

Posted in tech | 3 Comments

prose

who writes prose like this?

Washington, which was just weeks ago in the grip of neoconservative orthodoxy and absolute belief in Bush’s inevitability and righteousness, is now in the throes of agonizing events and being ripped apart by investigations. Things fall apart; all that was hidden is revealed; all sacred exposed as profane: the military, loyal and lumbering, betrayed and embittered; the general in the field, Lt. Gen. Sanchez, disgraced and cashiered; and the most respected retired generals training their artillery on those who have ill-used the troops, still dying in the field; the intelligence agencies, a nautilus of chambers, abused and angry, its retired operatives plying their craft with the press corps, seeping dangerous truths; the press, hesitatingly and wobbly, investigating its own falsehoods; the neocons, publicly redoubling their passionate intensity, defending their hero and deceiver Chalabi, privately squabbling, anxiously awaiting the footsteps of FBI agents; Colin Powell, once the most acclaimed man in America, embarked on an endless quest to restore his reputation, damaged above all by his failure of nerve; everyone in the line of fire motioning toward the chain of command, spiraling upward and sideways, until the finger pointing in a phalanx is directed at the hollow crown.

Answer: Sid Blumenthal, in Salon. I’m not sure if this makes me want to read the clinton wars more or less now…

Posted in politics | Leave a comment

A Brief Windows Rant

As long as I’m here –

MAKEINTRESOURCE() has to be the most rediculous fucking thing ever. What the hell were you people thinking? Seriously?

Posted in tech | Leave a comment

C++, Java

After about a year and a half of doing pretty much pure java (though also some time on
wx4j (a Java binding for a C++ GUI toolkit), I started a new job doing primarily C++ development. It’s also win32 instead of linux/crossplatform, but that’s not super germane, really, since so far I haven’t done much UI programming. In fact, I’ve been lucky enough to be able to keep almost all the win32 API at arms length, which from what I have had to deal with of it is quite lucky.

Things I knew I would like:
1) const correctness.

2) operator overloading.
It’s one thing to be able to implement operator[](const string& key) {}…. but being able to implement operator const string& () is really awesome. For example, I have a simple readonly XML object model:

class Element
{
        /* subscript operations not const-safe */
    mutable map<string, vector<Element *> > children;
    string content;
    string name;
public:
    /* only called externally to create the root */
    Element(const string& name);
    ~Element();
    /* input functions */
    Element* add_child(const string& name);
    void add_content(const string& newdata);
    void close(void);
    /* accessors */
    const Element& operator[](const string& key) const { return get(key); }
    const Element& get(const string& key, size_t pos = 0) const;
    operator const string&() const { return content; }
    size_t childcount(const string& key) const {return children[key].size(); }
};

the implementation of this is mostly pretty straightforward; the .cpp file defines a const Element empty_element, which get() returns if the key isn’t found or the offset is out of bounds. close() sets a flag which add_child and add_content both honor. For a long-lived object, it would make sense to have the vectors and map resize themselves to their current exact size on close(), but for my application that’s not really necessary because the object is destroyed pretty quickly. The only pain in the ass is that the destructor has to loop through the map and the value vectors and free all the memory, but that’s pretty easy.

Obviously it’s only a subset of the real XML API — I don’t support attributes or namespaces at all. But for what I’m doing, it’s sufficient, and it sure beats the hell out of MSXML DOM, which is full of COM crud.

And while I’m on the subject — this really was necessary. The DOM API is fairly inadequate, but mix that in with the need to cast every single input string to a fucking variant, and I’m ready to kill everyone who’s ever worked within 10 miles of microsoft HQ.

Things I miss:

IntelliJ. Dear god. I am going crazy without the ability to do certain refactorings. I create a ton of const string& references because getting the content of an element was much harder with the first iteration of the API. I’d like to just highlight such a reference and choose “remove variable”, which in IntelliJ would result in a prompt to replace each usage of the variable with the initializer. Instead, I’m manually copying and pasting… or worse. Oh well.

Other than that, not much. If I end up doing stuff more involved with the UI than just the current XML -> PDF report generation stuff I’m doing right now, I’ll probably start screaming, but that’s not C++’s fault — it’s Microsoft’s.

Posted in tech | Leave a comment

Fair Warning, Part Deux

No really, it seems like I’m going to have lots of stuff to bitch about with windows. I already have a pretty good rant worked up on what a gigantic motherfucking pain in the ass it is to use MSXML after using Java’s DOM (ignoring the more convenient implementations like JDOM and even TinyXML). I might as well subtitle the next few months “A Unix Yankee in King Gates’ Court”.

Posted in tech | Leave a comment

Hungarian Notation

Once upon a time, I was young and foolish and ignorant, and writing some code in Visual Basic. (Visual Basic 3. In 1994. Get off my back.) I learned that many people used this weird convention, where, say, a text control started with txt. txtName seemed kinda weird to me, since you knew the name entry box was probably a text control anyway, and besides, if you changed the type, you’d have to rename the variable EVERYWHERE it was used, even places where it didn’t matter what it contained, just that you were placing it somewhere. But I got used to it. Later I discovered that almost no one outside the windows programming community and not everyone within it used this style, finding it unnecessarily verbose.

Well, now I understand why it’s used so much. Sure it’s easy to tell what a variable’s type is from its function most of the time, but what if you have a huge array of redundant and overlapping types? Not so easy now, eh? i mean, the variable fileName is obviously a string. In C, char * or const char *, in regular C++ probably std::string (or maybe char * if you’re interfacing with C code). In Windows … hah. No such luck. It might be a char *, wchar_t * or TCHAR * (often referred to by typedefs like LPCTSTR, long pointer to C t_string), or it might be a std::string, or a BSTR or VARIANT string (or one of the wrapper classes like _bstr_t or _variant_t), or one of the higher level wrappers like CString, CComBstr, CComVariant, COleVariant, or in managed C++, the new .NET System::String.

Jesus christ in a handbasket.

Posted in tech | 1 Comment