Archive for September, 2005

Goodbye to Visual Studio web projects and SourceSafe

Thursday, September 29th, 2005
A bullet

Bite the bullet. Get rid of both SourceSafe and web projects, in one fell swoop.

I am not the only one who dislikes Visual Studio .Net web projects and SourceSafe. I am using the term “dislike” loosely here, as one “dislikes” cranial hemorrhaging and Richard Clayderman. They are worth getting rid of, but it can be hard to bite the bullet and get it done, and the hand editing can be tedious work if you have a lot of web projects.

So I wrote a couple of utilities to make it a little easier. One, EnableWebItemsInNonWebProjects.exe, is for tweaking your Visual Studio .Net 2003 installation to support web items in non-web projects. It is an automated implementation of this method.

The other utility, MakeLifeBetter.exe (sorry for the whimsical name; these are quick hacks and my productization department is on leave), is for simultaneously converting web projects to “local” (non-web) projects and stripping away SourceSafe bindings if they are present. I find that it is advisable to make these two changes together, for two reasons:

  • If you convert web projects to non-web projects while still hosting them in SourceSafe, others will experience weirdness when they “get latest” and receive your changes. [One of my biggest pet peeves with the combination of the Visual Studio .Net 2003 project system and SourceSafe is that problems never seem to be perceived clearly, they always seem to be "weirdness" or "voodoo" (of the mythical nasty variety) until you start delving under the covers. I don't like the covers, I guess.]
  • If you migrate to Subversion while still using web projects, Visual Studio will have problems, because web projects are not happy about subfolders with names like .svn. Your mileage with other version control systems may vary.

So assuming you want to migrate to a proper version control system and abolish the use of web projects in your work, then this utility may be for you.

If you want to make only one of these two changes to your solution, then you’ll have to make the appropriate (fairly obvious) modifications to the source code, which is provided in the download. It is undesigned and uncommented and unglamorous; I know. Don’t bug me about it.

A smiley face

Now that I’m no longer subjected to SourceSafe and web projects at work, I look roughly like this. With more hair.

I recommend:

  1. migrating your tree as-is to a fresh Subversion repository using vss2svn (I suggest the bugfix branch, login as guest:guest),
  2. checking out a working copy from your new repository (e.g. using TortoiseSVN),
  3. running this utility on it,
  4. trying it out in Visual Studio, and
  5. committing the changes.

I also strongly recommend just working with TortoiseSVN and not bothering with the source control functionality in Visual Studio. It may just be a matter of preference, but give it a try, at least.

Both of these utilities are command-line tools. Both print terse usage instructions when invoked without arguments.

Caveat: these are quick’n'dirty hacks. Error checking may be charitably described as “scant.” They have been tested on one (1) VS.Net installation and one (1) solution, containing twentyish web projects. They worked in these test cases. In your case, they may very well steamroll your project into the ground, bankrupt your company, poison your relationships with your loved ones, and give you cooties. Use at your own risk. Read the source code. Make sure you do not stand to lose any work if it all goes awry. Back up your VS.Net installation. Work on a pristine working copy from a reliable version control system. Diff to check that it did the right thing. Do not — do not — sue me. Always sue only those who have money, that’s where the return on investment is, and you get to feel like Robin Hood. Watch your cholesterol. Cut down on caffeine, TV, hallucinogenic drugs, and procrastinatory blog surfing. Read Chekhov. Work out. In your darkest moments, in your deepest despair and loneliness, remember that in that state your forward vision is impaired: there are better times ahead, though you cannot see them. This too shall pass.

Here is the download: IDetestWebProjectsAndSourceSafe.zip. Sorry for that name too.

Töluorð og mælieiningar

Wednesday, September 28th, 2005
Haðarrúnir --- Braille

Ofuríslenskað heiti fyrir blindraletur. Hér hefur Háfrónskuhreyfingunni orðið á í messunni dýrdeginu; þetta er enska stafrófið!

Fyrir tilviljun rakst ég á síðu um Töluorð og mælieiningar á kjarnyrtri íslensku.

Síðan reyndist vera hluti af stærra vefsvæði, aðsetri Háfrónskuhreyfingarinnar, sem leggur stund á „ofurmálhreinsun.“ Þar getur að líta skemmtilega orðalista á við Háfrónska hreinleikarýninn, og Kenningasmiðju þar sem meðal annars kemur fram íslenska nafnið á „molotov-cocktail“ — múspellsmilska!

Ég get ekki nógsamlega lýst því hversu þessi hraðlestur kætti mig; mun skoða þetta betur í betra tómi. Og vitanlega mun ég leggja mig fram um að nota þessi orð framvegis.

Vonandi veitir þetta þér svosem eins og skreppu eða lúkuþriðjung af gleði, eða fleygir þér nokkrar ruddur eða jafnvel arðurfar (a.m.k. nokkrar dyrgilstikur!) fram á við á menntaveginum.

Fjárinn. Nú verð ég glottandi eins og bjáni í allan dag.

Children, religions, and deception

Tuesday, September 27th, 2005
Symbols of various religions
Symbol of the Watchtower Society

Symbols of various religions. Your child may have classmates stuck with one of those “other” symbols. Make sure your child treats them right.

If a seven-year-old child, not a close acquaintance, asks you whether you believe in Santa Claus or the tooth fairy, do you tell them the truth?

(I am assuming you do not, in fact, believe in Santa Claus or the tooth fairy)

Maybe you say you do. Maybe you find it a harmless lie about a not-particularly-relevant part of the world, and there is no hurry for the child to know the truth. I might. I don’t know.

How about if the little child asks you something a bit more relevant: whether you believe in God? And it so happens that you don’t?

I had to answer that question for myself this afternoon. A co-worker’s daughter was at our office waiting for him to finish. She was horsing around and asking questions, and this one came out of her.

I hesitated briefly, then said “no, I don’t.” She giggled, asked “really?” and then said I was weird, and that she was certainly determined to believe in him. She then proceeded to horse around some more. I doubt that the experience left her psyche particularly scarred.

Why did I hesitate? I was wondering whether something obligated me to lie to her or refuse to answer the question. By statistics, she is probably being raised believing in God. Am I improperly meddling in her parents’ approach to her upbringing, by telling her truthfully what I believe? Am I giving her trouble? Thoughts too hard to deal with? Should I make a best guess at what her parents want her to believe, and play along with that?

Let’s look at it differently: say I was Jewish, and she asked whether I believed in Jesus Christ being God’s son and part of a Holy Trinity. If I went along with her religion’s version of the world, or carefully avoided letting her know that my version was different, wouldn’t I be belittling my faith, implicitly accepting the idea that my religion’s version of the world was somehow inferior or undesirable or shameful, its existence an inconvenience that shouldn’t be inflicted on such a little child? Expecting a Jew to do this would be quickly found rather unreasonable, wouldn’t you say?

Well, as it happens, my world-view is not Judaism, it is atheism. My conception of the world does not contain a god. Is this world-view inferior and undesirable? Should I be expected to hide it from children who ask? Should I be ashamed of it?

Apparently, to some extent, I still am. I did hesitate, wondering whether telling the truth would be offensive or wrong somehow.

In my society, one is “supposed to be” a Christian. But we are fairly lax about this, thankfully. I do not feel it too often. Not too many years ago, someone close to me heard me say something in which my atheism was implicit, and asked “Wait, you don’t believe in God?” in a bit of a shocked tone. Wide-eyed, I said “well, no.” I was quite surprised; I had not expected this to be news to anyone close to me. This person said “oh well, you’ll grow up out of it.”

Whaaat?

And we atheists are said to be disrespectful of other people’s views.

But putting aside my own right to feel unashamed of my world-view, what about the little girl who asked? Is she better served by hiding from her — for the time being — the fact that opinions differ on the Big Questions? Is that for later? How about the “other-minded” kids she might go to school with, Muslims or Jews or atheists or what-have-you? Are they well served by being placed in an environment where all the “normal” kids are apt to regard “other” religions as a foreign concept, weird, abnormal, shameful? Is that fair?

I say hell no. No pun intended. The sooner kids get to learn about diversity, the sooner they can learn to respect it, and by extension, each other. And the sooner they can begin their own process of challenging their pre-installed givens and deciding for themselves what to believe … a process that not only depends on a person’s mental maturity, but also drives it.

The objective of shielding young children from the complexities of this world is well-intended and valid in itself — but it should be taken in moderation, in a trade-off against the opposing objective of not installing their starting prejudices too firmly.

So I do not regret being truthful with her. If she was old enough to ask that question, she was old enough for a truthful answer to it. Telling children the truth sometimes does good and sometimes does harm, and sometimes does both. I think the truly harmful cases are few and far-between, so I plan to err on the truthful side. Tell it gently and carefully, but do tell the truth. Wherever feasible.

What does Bush read?

Sunday, September 25th, 2005

Some people might prefer to rephrase the question as “Does Bush read?” and regard it as rhetorical.

Lately I have been increasing the time I spend reading. I have been reading Chekhov, Proust, Breiðfjörð :), Einar Ben and plenty more … and all of these I chose simply because I had heard that they were worth my time, from people I trusted with that judgment. The choice of what to spend your time reading is a nontrivial one: we have a disastrously short time on this earth, and the number of books we can possibly read in our lifetimes is alarmingly minuscule compared to the number of books worth reading.

So here is an interesting project: Who Reads What? All kinds of well-known people (politicians, actors, writers, musicians) are asked for recommended reading, and their replies are published along with brief comments. What does Nelson Mandela recommend? How about John Kenneth Galbraith?

Sure, there are plenty of people recommending things like Tom Clancy novels, but there are interesting entries as well.

Yes, George W. Bush does have an entry in there … as “the governor of Texas.” It is from 1999, possibly before it was clear that he would run for president, so his answer is at least less likely to be written by a crack team of psychologists specializing in electoral profiling or PR, than if he were asked a year later or any time since.

There is a new list of dozens of people each year, and it’s been going since 1988, so there is a fair number of entries by now. This is an interesting collection to browse through, not only as a tiny peephole into the minds of well-known people, but also as input from people you respect into your own process of deciding how to spend your ridiculously small amount of reading time in the vast world of stuff to read.

Andrúmsloft og jarðvegur

Saturday, September 24th, 2005

Þetta er á gólfinu í íbúð systur minnar.
Dettur þér í hug gott nafn á það?
Mig grunar nefnilega að þetta gæti verið spliff, donk og gengja — all-in-one útgáfan.

[...]Það er hins vegar Svarti-Pétur í stokknum. Stóru keðjurnar hafa í skjóli einokunar keyrt upp matarverð. Hreðjatak þeirra á markaðnum hefur kallað fáheyrða dýrtíð yfir neytendur. Ég tel að ríkisstjórninni beri skylda til þess að feta í fótspor verkalýðshreyfingarinnar og fara í viðræður við þá aðila, krefjast þess í nafni þjóðarheillar að þeir sýni ábyrgð og þeir lækki matarverð. [...] Ef fortölur duga ekki til, herra forseti, þá er það skoðun okkar í Samfylkingunni að Samkeppnisstofnun eigi að fá í hendur þau tæki sem hún þarf til þess að skipa fyrir um breytingar, þar á meðal að skipta upp slíkum einokunarrisum ef hún telur þess þörf til þess að vernda hagsmuni neytenda.[...]

Össur Skarphéðinsson, í þingræðu 22. jan. 2002

[...]Hvað ætlar ríkisstjórnin að gera?

Eitt getur hún gert, tekið undir með hv. þm. Kristni H. Gunnarssyni og þingmönnum stjórnarandstöðunnar og ráðist gegn einokun hvar sem er, ekki síst á matvælamarkaðnum. Við höfum séð að þar eru að koma upp risar sem í skjóli ríkisstjórnarinnar ætla greinilega að fara sínu fram. [...]

Össur Skarphéðinsson, í þingræðu hálftíma síðar

[...]Við erum innflutningsþjóð. Við lifum á innflutningi að verulegu leyti. Við komumst ekki hjá því og breyting á mati á verði krónunnar okkar hlýtur að leiða til hækkandi vöruverðs, þ.e. ef gengið lækkar. Nú þegar það hækkar á nýjan leik jafnt og þétt leiðir það með sama hætti, og a.m.k. á að leiða til þess með sama hætti, að verðlag fari lækkandi og hagur manna styrkist hvað það varðar. Auðvitað á að fylgja því eftir að stórir aðilar séu ekki að misnota aðstöðu sína. Auðvitað er 60% eignaraðild í matvælafyrirtækjum, verslunarfyrirtækjum í matvælaiðnaði, allt of há hlutdeild. Auðvitað er það uggvænlegt og sérstaklega þegar menn hafa á tilfinningunni að menn beiti ekki því mikla valdi sem þeir hafa þar af skynsemi. Auðvitað hlýtur að koma til greina af hálfu ríkisins og Alþingis að skipta upp slíkum eignum ef þær eru misnotaðar.

Davíð Oddson, í næstu ræðu á eftir.

Ingibjörg Sólrún virtist vera að ræða umhverfisvernd á Stöð 2 í kvöld, þar sem hún talaði svo mikið um andrúmsloft og jarðveg. En hún átti við pólitískt andrúmsloft haturs út í „ákveðin fyrirtæki,“ þungt loft sem hún vill meina að sé upprunnið úr Davíð Oddssyni. Svona loftslagstal gæti virst grunsamlega óljóst og huglægt og pómó — jafnvel loftkennt — en það eru óþarfar grunsemdir, því að hér fyrir ofan er beinhörð sönnun orða hennar: Davíð Oddsson stuðlaði bersýnilega að þessu andrúmslofti … með því að taka undir með þáverandi formanni Samfylkingarinnar.

Með góðum vilja er alveg hægt að sjá ræðu Davíðs sem einhvers konar heróp hans gegn Baugi … ef þess er gætt að vitna í hana án samhengisins við ræður Össurar, sem hún var svar við. Það hentar víst ekki núna að rifja upp fjandskap fyrrv. formanns Samfylkingarinnar út í Baug. Núna hentar að segja að fjandskapur út í Baug hafi verið einhver einkauppfinning Davíðs.

Ég er með kenningu. Vissulega skipaði Davíð ríkislögreglustjóra (í þolfalli). En ég hef Össur grunaðan um að hafa skipað ríkislögreglustjóra (í þágufalli) að veitast að Baugi. Þetta er eitthvað sem við vitum öll en þorum kannski ekki að horfast í augu við. Ríkislögreglustjóri er greinilega viljalaust handbendi Össurar. Ég finn það á hinu pólitíska andrúmslofti í þjóðfélaginu. Össur hefur gefið út þetta umtalaða veiðileyfi. Ef þú finnur það ekki, þá hefurðu bara ekki þann sans sem ég hef fyrir jarðvegi þjóðfélagsins. Þig skortir pólitíska græna fingur. Það eru straumar í hinu pólitíska umhverfi sem ekki ljúga. Ákveðin undiralda sem við skynjum svo að ekki verður um villst.

Þetta eru skemmtilegar leikreglur. Með því að láta hlutina ekki snúast um áþreifanlegar staðreyndir heldur andrúmsloft, jarðveg, strauma og undiröldu — pomobabble — getur þú sagt hvað sem þér sýnist. Þú þarft ekki að sanna neitt, þú þarft bara að hljóma nógu sannfærandi. Og salta það með „þetta er eitthvað sem við vitum öll“ svo að fólk þori nú ekki annað en trúa. Sniðugt.

Þess vegna segi ég, með miklum sannfæringarmætti, að Össur hefur þvingað ríkislögreglustjóra út í Baugsmálið. Gæti jafnvel hafa slúttað bréfi sínu til hans með hótunum á borð við „you ain’t seen nothing yet“ og „í guðs friði — en ekki mínum.“ Eða bíddunúvið … hverjum skrifaði hann aftur þau orð?

F’gati for a little while

Monday, September 12th, 2005
F\'gati

In celebration of the new look of my blog, I’m changing the blog’s name temporarily to F’gati. If you can’t spot why that is, then that’s just as well; I’m groaning about it myself.

The Nigger Tax

Sunday, September 11th, 2005
Plant thingy

I couldn’t think of any picture that was cleverly appropriate to this post, so instead here is a picture of a plant thingy in the gardens of Farmleigh House, Phoenix Park, Dublin, Ireland.

No, the title of this blog post does not indicate disrespect for anyone. Except of course the people who levy that tax.

What tax? The Nigger Tax. Read it.

I don’t think I have ever (since elementary school anyway) seen anyone dissed so thoroughly on such lousy grounds. I’m not sure how I’d react if I witnessed that tax being levied on someone. Nor how I’d react if it were levied on me. In the latter case I suppose I would probably shrink up and leave, wimpy though that may seem. It is somehow less dignified to demand respect for oneself than for someone else, and anyway I hope the heat of the moment will not blind me to the fact that the tax collector is not worth a second of my time or a joule of my energy.

[Update: Since writing this, I have witnessed that tax levied on someone. My reaction consisted mostly in dislocating my jaw; the tax collectors were gone before I could think of anything more apt.]

We have a history of racial homogeneity in this country, curtailed in recent years by a sharp rise in immigration; it seems likely that such rapid demographic changes would cause a rise in racism. When I loved a young woman of dark-skinned ethnicity (well, dark compared to mine) in another country, I worried about the prospect of her living with me in Iceland; I feared how my countrymen might treat her. But she was treated just fine when she visited. And I have never seen anyone here (or elsewhere) indulge in Nigger Taxation. No doubt it is being done, but it is rare enough — or isolated enough — that I haven’t seen it. That’s a good thing.

But many of us are guilty of a smaller-scale version of the Nigger Tax, and perhaps of its inverse — the Whitey Subsidy, if you will. We treat the people we find attractive better than the people we don’t. If an unattractive woman asks me for a favor, I may well happily do it … but I will do it more happily if an attractive woman asks. And if the favor is so big that I am not sure I am willing … then I am more likely to do it for the beautiful one. There is no point denying this tendency, though I’m hardly proud of it.

We can split the causal relationship in two: I am more likely to do a favor for a friend or someone I like, than for a stranger or someone I don’t particularly like (even if I don’t particularly dislike them either). And an attractive woman (or charismatic man) is more likely to be considered a friend and liked, than an unattractive woman (or uncharismatic man) — other things being equal.

Is that a moral failing? I think that depends on the relative importance of attractiveness vs. other factors — what happens when other things are not equal. If my priorities are straight; if my bias for attractiveness is easily overridden by my appreciation of politeness or amicability or whatever other positive character traits may be apparent … then I’m probably OK, morally speaking.

But the effect is there, and we are often unaware of it. Attractive people are probably generally unaware of it too, when they benefit from it.

[Sidenote: Alexander McCall Smith wrote a book called "Morality for Beautiful Girls" and I don't want to read it because I am certain that it is not as good as its title. Just like the Tom Waits song "Warm Beer and Cold Women" is not as good as its title --- good though it is.]

Maybe I am guilty of mild forms of nigger-taxing when I am not paying attention. I want to try to be more attentive to that. You do the same, ok?

Pigeons and statues

Monday, September 5th, 2005
Droppings-covered statue with a bird on its head

“Accept that some days you are the pigeon, and some days you are the statue.”

— David Brent, Wernham Hogg

The ability to accept being the statue is called “æðruleysi” in Icelandic. What is the English word for that? I can’t recall anything that fits it exactly.

There is dignity in being the statue.

A statue is able to hold its head up high when the guano strikes.

A statue will accept almost anything.

(Much like a doormat, come to think of it.)

Let’s have some of that. Next time the pigeon swoops in … stand perfectly still. Grin and bear it. You know what to be.

Æðruleysi or bust!

The wine monopoly

Sunday, September 4th, 2005
A controlled substance

CH3CH2OH, a controlled substance. The illustration is flawed: one H is missing, perhaps for the sake of decency.

Þrátt fyrir að áfengisgjald hér á landi yrði lækkað um helming yrði það svipað og í Svíþjóð og áfram það langhæsta innan Evrópska efnahagssvæðisins.

[Roughly: Even if the alcohol fee in Iceland were cut by one-half, it would be similar to that in Sweden, and still by far the highest in the European Economic Community.]

These are the final words of the supporting arguments for a bill proposing to reduce state monopoly on alcohol retail sales in Iceland (making the monopoly apply only to alcohol stronger than 22%, among other changes). This has been proposed in parliament for the nth time, where n is an embarrassingly large number. It was approved for “a second discussion.”

Each time this is attempted, as well as each time I travel abroad and see wine in stores, it sharpens my astonishment — normally dulled by the pernicious it’s-always-been-that-way effect — that even now, in the 21st century, the government of this otherwise relatively free country still persists in monopolizing the doling-out of beer and wine to us, and gouging us for it with government fees. Ostensibly to protect us from our own folly.

Yes, there are people who have problems with their alcohol consumption. Does anybody really believe that the state monopoly is helping them?

Now, if you’ll excuse me, I’m sauntering off to Kaffitár, a café down the street. Kaffitár, in addition to serving the world’s best cappuccino (equalled by Te&kaffi and Segafredo on Lækjartorg, but surpassed by none), does not allow smoking. Not because smoking in cafés has been banned by law — though that will probably happen here before long — but simply because it chooses to. I like that.

C# compiler bug

Friday, September 2nd, 2005
A spider in a web

Here’s one techie posting to alienate my regular readers (both of them) … I’ve encountered an apparent bug in the C# compiler in Visual Studio .Net 2003. Witness:

public interface ProductRow
{
	int Count { get ; }
	int Price { get ; }
}
public class ProductRowCollection
{
	public ProductRow this[int index]
	{
		get { return null; }
	}
	public int TotalPrice()
	{
		return ( this[0].Count * this[0].Price );
	}
}

(Yeah, I know the code is silly; I stripped it down for display purposes.)

This causes the compiler to bork with the following errors:

test.cs(14,20): error CS1513: } expected
test.cs(14,33): error CS1031: Type expected
test.cs(14,42): error CS1519: Invalid token ‘)’ in class, struct, or interface member declaration
test.cs(16,1): error CS1022: Type or namespace definition, or end-of-file expected

The first error is signalled on the reference to the Count property getter, a perfectly decent member of ProductRow. I am fairly sure the code is valid. The error seems to indicate something going awry in lexing.

It goes away if I put in a + instead of the * … maybe the compiler is confusing itself by mistaking the multiplication operator for a pointer indirection operator, for some reason? The C# language specification seems a little vague on the precedence and associativity of the pointer indirection operator; is it possible that this really is invalid code and the compiler is correctly rejecting it but just giving a shabby error message?

It also goes away if I comment it out and back in! This is really odd: I get this in Visual Studio, indicated with a red line under the Count reference, and I try to build and I get the compiler error … and then I comment the line out, then uncomment it again, and I don’t get a red line and it compiles! It makes sense that the syntax highlighting “snaps out of it” when I comment and uncomment … but the compiler too?

Of course that’s a shoddy, brittle, voodoo workaround, and sure enough, when I check it in it gets picked up by the automated build system and the same compiler error comes up there.

A sane workaround is to extract ProductRow row = this[0]; and write row.Count * row.Price … this way no error is raised. Probably judiciously applied parentheses would achieve the same.

I googled a little bit, but didn’t find anybody talking about this kind of glitch. So I hereby ceremoniously christen it The Marteinsson Mess, after my coworker who stumbled on it.

Update: this has been fixed in .Net Framework SDK v2.0 Beta 2.