Quantcast
Channel: Foolish Assertions
Browsing latest articles
Browse All 11 View Live

Assertion #1

Occasionally, I have interesting thoughts. It is conceivable that I may, one day, consider some of them to be worth writing down. Time will tell.

View Article



More foolishness; now with added drunkenness

Well, it seems my last post was a year ago, and it therefore seems likely that I may actually be dead before I get around to making another. I wish this was a joke.However, with that sobering...

View Article

Deadly Serious This Time

At 32 Great Queen Street in London, there is a restaurant called -- imaginatively enough -- 32 Great Queen Street. We just ate Sunday lunch there; the confit duck was probably the single best dish I...

View Article

.NET Marshalling: a mildly sarcastic Q&A

1) Want to read or write a chunk of unmanaged memory that you know holds a double?Easy! Just use Marshal.ReadDou... oh. Hmm.OK, it seems that -- while doubles work fine in arguments, return values and...

View Article

Silver Bullets Aplenty

Context: We all know that there's no silver bullet that will slay the metaphorical werewolf embodying the fact that Making Software Is Difficult; we're also familiar with the difference between...

View Article


Python return dictifier

I wrote this the other week, and thought it was cute enough to share:def _dictify(keys, result): if len(keys) == 1: return { keys[0]: result } return dict(zip(keys, result))def return_dict(keys): keys...

View Article

Another snippet

I realised you could do this about a year ago, but I only just found an opportunity to use it.def merge_dicts(d1, d2): return dict(d1, **d2)Satisfying :).

View Article

Spare batteries for IronPython

As we all know, Python comes with batteries included in the form of a rich standard library; and, on top of this, there are many awesome and liberally-licensed packages just an easy_install...

View Article


Where's a plumber when you need one?

Assertion: On Win32, there's no point bothering with subprocess.PIPE -- just use tempfile.TemporaryFile instead.Context: You create a Popen(cmd, stdout=PIPE, stderr=PIPE), and you let it run (with a...

View Article


The Joy of Self

I have a distant and fuzzy memory, from back in the day... when I was but a wee slip of a lad, sallying forth to do battle with million-line C++ monstrosities (and just barely escaping with my sanity...

View Article

A Crime Against Nature

Every so often, while writing Python, I've found myself wishing I could easily dispatch method calls according to the type of the arguments. The urge usually passes quickly, but... oh, the hell with...

View Article
Browsing latest articles
Browse All 11 View Live




Latest Images