27 March 2008

smoke-filled brains

the best quote that shows the thinking of political bosses regarding "democracy."
“From my perspective,” said Jerry Meek, the chairman of the N.C. Democratic Party, “whenever you have a plurality electoral system like we have, where the person with the most votes prevails, third parties simply have the tendency to distort the electoral process in ways that don’t adequately represent the wishes of the voters.”
how is "letting" people vote for whom they choose distorting their wishes? so rather than implement a better form of vote counting, our political betters will select for us a reasonable offering. the next step, of course, is to make voting mandatory.

testing anti patterns

i came across a great list of anti patterns for unit testing. i try to avoid these guys, but i've definitely done each one at some point.

19 March 2008

an intersting thing happened to me on the way to databinding

i came across an interesting bug (yes, bug) in the .NET BoundField class. seems .NET doesn't care much for NHibernate. or duck typing. or both. given a data source of [proxy of EntityA, instance of EntityA], a bound field in a data view on my page no likey the binding.

basically, the symptom was that i got an annoying message that didn't tell me that the reflection the bound field used was expecting an instance of a different type than what it got, which surprised me, given that i thought i was binding to a list of two EntityA instances. well, if the first item is the proxy, the binding blows up; if the first is standard EntityA, the binding works. my guess is that the BoundField class caches a PropertyInfo class to use in retreiving the value of each successive item, and that PropertyInfo is bound to a particular type.

turns out i solved this problem by implementing my own BoundField (that further supports OGNLish syntax) by not caching. at least this class isn't sealed.

performance first!

18 March 2008

resharper is the bomb!!!11!

i am a huge fan of resharper. i don't code c# anything without it anymore since the MS IDE basically has the intelligence of a chicken. that was proved to me yet again today as i had a support person on the phone, walking him through our functional tests today.

me: just add a test class to that project.
me: right. don't forget your TestFixture attribute.
me: now just type the method name and we'll generate it--oh, sorry, you don't have resharper, do you?
me: don't forget the Test attribute.
me: ok, let's go create the actual method now.
me: you misspelled it.

you get the idea. what took him about 5 minutes to accomplish, i could do in 5 or 10 seconds. and know it was done right. he no access to our shared code style conventions, code snippets, etc. it even provides the ability to navigate nant build files as if they're code.

even for all the stuff i want, i still haven't really fired up VS2k8 since R#4.0 isn't out just yet. i guess i'll have to install the beta.

14 March 2008

ganz verrückt

the geheime staatspolizei were tipped to a number of american terrorists researchers and scientists using the title 'Doktor' self-referentially.

Under a little-known Nazi-era law, only people who earn PhDs or medical degrees in Germany are allowed to use "Dr." as a courtesy title.

i think that says it all. don't mention the war!

more illegal wiretap stuff

In this episode, we follow our wayward enforcement agency as it tries to make up for its misdeeds by issuing subpoenas after the fact. Maybe next episode they'll shoot somebody, and afterwards begin an investigation on whether they were a criminal or not. We're cool as long as we can fudge the paperwork, right?

At least the FBI has rules against this sort of thing. They at least try to be good, even when they fail. Not so much with some of the other gubmint agencies.

13 March 2008

worst bills in congress

Jeff Flake gives his opinion on the worst bills in congress.
1. The Farm Bill: “Both the House and Senate versions of the farm bill extend subsidies, distort markets, and hamper future free trade agreements, and the final bill is only likely to get worse in a conference committee. Sugar growers who didn’t get what they wanted in the initial legislation are urging conferees to repeal portions of NAFTA.”

2. The Omnibus Appropriations Bill: “Congress rolled 11 appropriations bills into one massive package and passed it in late December. House members had less than 24 hours to read the legislation before we voted on it. We’re still finding out what’s actually in the bill. But we do know it contained nearly 12,000 earmarks. That was reason enough to vote ‘no.’”

3. Economic Stimulus Package: “Any time Republicans and Democrats can so easily agree on legislation as expensive as this, it’s not a good sign. Rebates look to me like an admission by Congress that perhaps the federal government shouldn’t have taken that money in the first place. Hopefully, Congress will keep this in mind as the Bush tax cuts get set to expire.”

06 March 2008

Becoming a savvy consumer

Here's a neat article about how to keep your kids from becoming slaves to the ubiquitous marketing campaigns that we're bombarded with on a daily basis.

I´ll show you mine if you show me yours

I ought to just stick a feed in here directly from Bruce Schneier´s column at Wired. Today he points out why it´s not okay to reveal everything to the gubmint, and why it is okay to get the gubmint to reveal everything to the public.

If I disclose information to you, your power with respect to me increases. One way to address this power imbalance is for you to similarly disclose information to me. We both have less privacy, but the balance of power is maintained. But this mechanism fails utterly if you and I have different power levels to begin with.

As an addendum, here´s another article at Wired about more gubmint wiretapping. Actually, that makes it sound tame. How about ¨wholesale surveillance¨?

03 March 2008

enjoy that coke; you let the terrorists win

gubmint farm subsidies are not just about propping up an artificially prosperous regime. they actually hurt the people who are growing healthful food. all gubmental action is at someone else's expense.

The commodity farm program effectively forbids farmers who usually grow corn or the other four federally subsidized commodity crops (soybeans, rice, wheat and cotton) from trying fruit and vegetables. Because my watermelons and tomatoes had been planted on “corn base” acres, the Farm Service said, my landlords were out of compliance with the commodity program.

I’ve discovered that typically, a farmer who grows the forbidden fruits and vegetables on corn acreage not only has to give up his subsidy for the year on that acreage, he is also penalized the market value of the illicit crop, and runs the risk that those acres will be permanently ineligible for any subsidies in the future. (The penalties apply only to fruits and vegetables — if the farmer decides to grow another commodity crop, or even nothing at all, there’s no problem.) (emphasis added.)