28 October 2008

castle dynamic proxy

on a lark, i decided to play with the castle dynamic proxy library. it was fairly easy to use it to create a simple extension method to broadcast method invocations to all elements of a list. it will even work with property setters and other extension methods, provided each is virtual. now is the (next) time i hate the fact that methods are sealed by default.


public static T Broadcast<T>(this IEnumerable<T> items) {
  return new ProxyGenerator().CreateClassProxy<T>(new BroadcastInterceptor<T>(items));
}


private class BroadcastInterceptor<T> : IInterceptor {
  private readonly IEnumerable<T> items;

  public BroadcastInterceptor(IEnumerable<T> items) {
    this.items = items;
  }

  public void Intercept(IInvocation invocation) {
    foreach (var t in items) {
      invocation.Method.Invoke(t, invocation.Arguments);
    }
  }
}


var a = new TestObject();
var b = new TestObject();
List<TestObject> list = Quick.List(a, b);
list.Broadcast().Poke();

19 October 2008

virtualbox no worky

i fell prey to the "spawning session" problem after the latest round of updates to ubuntu. turns out there's an easy fix for it.

18 October 2008

lulz

i have to say, i really enjoyed this post as a whole, including the comments. reminds me of when Bret and Jemaine got into a tiff and split up the band.

Ernest Madu on successes in african health care

we in the US can learn a good deal from studying those who achieve great things without having huge resources. this video is a strong statement against the mistake of Big Government thinking. imagine the access to health care we could achieve if we simply stepped back from our current unthinking debates and refactored the broken system.


(HT: Yip)

12 October 2008

neighborhood tyrants

i wish i could feel more humorous about this case, but it really just reinforces my hatred of HOAs and this strange green-at-all-costs grass fetish so prevalent in suburban USA. as Radley says, "It’s too bad the homeowner’s association had $795 to spend on attorney’s fees in the case, but couldn’t give the poor guy a couple hundred bucks to help him comply with the rule." seems he's having cash problems since his ARM went up $600/month. where's his bailout?

i'm glad i just re-seeded what little lawn i have left. here's hoping i don't have to spend too much on it to keep the lawn police away.

mmm pork pork pork

11 October 2008

cf isn't as good as they'd have you believe

even striking home mercury poisoning from the list of woes, we may simply be trading one harm for another. some doods from yale have generated a report and everything.
[M]uch of South America, Africa, the Middle East and parts of Europe, along with Alaska, California, Oregon, Idaho and several New England states, would actually increase their mercury emissions by making the switch from incandescent to fluorescent lighting. The results depend on a complex relationship between a number of factors, including how dependent a region is on coal-powered energy generation, the chemical makeup of the coal used in those plants, and existing recycling programs for CFLs.

"Compact fluorescent lighting is an area where we're really pushing this alternative and all these policies are being enacted, but we're not looking at the potential unintended consequences of what we're doing," said study author Julie Beth Zimmerman, an assistant professor in Yale's Department of Chemical Engineering and its School of Forestry & Environmental Studies.

i'm glad someone's looking. we're not safe until congress bans unintended consequences.

new new deal

i always appreciate a good post about FDR's effect on government.
A reason to vote for McCain? Certainly not. But definitely a reason to treat the Depression, the New Deal and FDR as sobering history lessons and not as epic mythology — or as empty-yet-dangerous campaign rhetoric.

09 October 2008

clone wars

Boy is now watching the star wars series *again.* something like 20 times now. i guess that's a thumbs up. aside from the inane dialog and polar express creepy animation, the stories are actually viewable by adults. as with all things star wars, don't expect acting awards.

more regulation is always better

it keeps us safe. i'm pretty well tired of hearing about how we need 'more' regulation. maybe we could start by making it right. we should be focusing on regulating the bullfunk coming out of DC.

08 October 2008

quote of the day-or-so

Is there any way to pull off this "democracy" thing without using actual voters?
Radley Balko

02 October 2008

timeouts

my elderly twin has been working on extending the timeout in asp.net so users don't get prompted to log in so frequently. after donking with all the silly xml config files and googling the bejeezers out of this topic, including much manual testing, he came across the magic forms authentication timeout xml attribute. so, dear reader, this nonsense wasn't caused by session timeout, but by authentication timeout. apparently, every single anything has a separate timeout setting tweakable from xml.

quote of the day-or-so

cat fights got nothing on dog humping.
scavinger