Ivan Krivyakov's Blog

Premature optimization is the root of all evil

November 24, 2009

Data flow diagrams

Just explained my project to a new team member and realized UML does not have standard way of expressing data flow diagrams. Indeed, it is an object-oriented toolset, and data flow is so-o-o 1970s.

Yet, even in our perfectly object oriented systems we do have a data flow. Our objects may be viewed as a bunch of filters that crunch data (trade data) translating it from format to format. If you make it a communication, or a sequence diagram, it would look pretty dull:

x ___ProcessTrade___→ y ___ProcessTrade___→ z

That’s the parameter type of ProcessTrade that changes, and this is what makes it interesting. A totally not object-oriented data flow diagram like this:

FixTrade ___x____→ XML ___x____→ Database

would be much more to the point. More and more often I recall Steve Yegge’s “Execution in the Kingdom of Nouns“…

November 22, 2009

WPF 3D Demo is Here

I have finally published it. WPF 3D demo demonstrates features such as 3D bodies (duh!), control templates, data binding, etc.

Sceenshot

What’s in a name? A patch by any other name would work as sweet

This week-end I was playing with some sources and I wanted to apply some patches to them. So, I downloaded patch.exe from GNU and tried to run it on Windows Vista. “Gevalt!” said Vista. “We are under attack by evil robots!!! This program wants to do something funky with you machine, do you really want to allow that?”. That was the famous UAC feature that requires confirmation when programs try to make administrative-level changes to the system.

But what kind of administrative changes did patch.exe try to do? Of course, it turned out that the program does not try to do anything wrong. It was its name that Windows did not like. If you rename it to something else, e.g. p.exe, it works just fine and without any warnings. Apparently, I am not the first to find this out: see http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/msg37590.html.

Surely, one can understand Microsoft’s logic. A program named patch.exe cannot be up to something good, can it? It must be a virus or something. Obviously, if the Bad Guys would write a malicious program they would name it patch.exe, or virus.exe, or at the very least will set something like the Evil bit.

BTW, it turned out that Windows has no objections against virus.exe. It’s patch.exe it is after.

Indeed, there are more things in heaven and earth, Horatio, than are dreamt of in our philosophy.

November 15, 2009

Automating .NET Executables Using COM

In one of my projects I needed to script a class inside a .NET executable.

.NET has very good support for in-proc COM components: you create a class library, add a class, put [ComVisible] attribute on it, and voila – you’ve got yourself a COM object. Scripts would instantiate this component via a CreateObject call, which would locate the DLL and load it into the client’s address space.

My scenario, however, was slightly different. I did not want a new instance of my component to be created inside the client process. I already had an instance in my own process, and I wanted to script it.

To full article…