Tuesday, February 23, 2016

Sayre's Law

Here's something I read about recently, seems to apply pretty universally. I love it when little bits of wisdom like this are declared "such and such's law", "xyz's paradigm", "joe's theory of blank". I don't know why I find it funny.

Wednesday, February 10, 2016

PNG's and DPI's

PNG's are a web image format, and as such try to be independent of the device dpi so you can set the resolution and image size in your css or let the browser handle it. However, we use pngs for some desktop applications. Because of inconsistent dpi settings on different pngs we had some weird behavior where wpf was blowing up our save icons, but not our open file icons. The result in wpf was to set the width, height, and stretch attributes to our image element manually, as well as the SnapsToPixels to true for antialiasing (though at that image size I couldn't see the difference).

To be sure the png's had different dpi's and that was the problem, I had to install gimp, open the png, look at the image properties and the resolution. It would have been nice if this was just in the details tab of the properties window of the image, but if I'm right that png's don't worry about dpi it would make sense that dpi is excluded there.

Friday, February 5, 2016

My Favorite Math Joke!

A farmer has 100 ft of fencing and wants to enclose as large an area as possible, so he does the obvious thing, and hires an engineer, a physicist, and a mathematician to consult him. The engineer quickly pens in a square with the 100 ft and says voila! The physicist, knowing he can optimize this, goes to the blackboard and finds that a circle would enclose a larger area. The mathematician, after much deep thought, pulls out two feet of fencing, wraps it around his waist, and yells "I declare myself to be on the outside"!