Articles tagged with Bafflers

SQLAlchemy with Python 64-bit on Windows

By Eric — 2 minute read

While hooking up SQLAlchemy for a web project, I kept running into attribute errors for 'session_registry'. I figured I was doing something wrong, so I thought I'd just walk through the tutorial as a sanity check.

I was, apparently, insane.

>>> u = session.query(User).filter_by(name='ed').first()
Traceback (most …

Read more...

.NET Color Struct Equality

By Eric

When is white not white? When one is Color.White and the other is Color.FromArgb(0xff, 0xff, 0xff, 0xff).

I was trying to data bind a list of colors to a ComboBox and have the SelectedValue property bound to a particular color. The frustrating thing was that even though …

Read more...

Unicode Surprises

By Eric — 2 minute read

I got a defect from QA today saying that our product was unable to track files in paths containing Unicode characters. I'll admit that I was skeptical. I had just tried that myself the other day and it worked perfectly. Trying it again today also worked perfectly, but the QA …

Read more...

Finding Unmanaged Memory Leaks

By Eric — 5 minute read

At work we had a long-running .NET process whose memory usage seemed to be going up, but not coming down. In investigating, I learned a few things about leak hunting, and ultimately tracked down perhaps the most insidious leak I've ever seen.

My first approach was to try to profile …

Read more...

ArgumentException Creating an XmlSerializer

By Eric — 2 minute read

I ran into a kind of baffling problem. I've got some .NET code that is also accessible to Java via JNI. There are unit tests for the .NET code that all pass. To test the Java to .NET connection, I wrote a few JUnit tests which worked fine when run …

Read more...