Blog posts page 34 of 44

Extend HttpApplication with session counts and uptime

It’s sometimes useful to know or display how many people are currently using your web application and how long it’s been up for.

As web applications normally inherit from System.Web.HttpApplicationSystem.Web.HttpApplication we can extend this class with a common re-usable class to add the required functionality.

Hardware hacking the MacBook movement sensor

Developers keep finding new and unexpected uses for hardware and software — seemingly never more so than on the Mac and OS X.

Whether they’re using the iSight camera to scan bar codes into your Delicious Library or turning the Apple Remote into a alarm key-fob in TheftSensor there’s always some novel hack around the corner for the latest bit of kit.

IEnumerable<T> as IEnumerable<BaseClassOfT>

  • đź“…
  • đź“ť 525
  • đź•™ 3
  • 📦 .NET
  • đź’¬ 10

A few weeks ago I touched on the substitutability of generic types and how Collection<BaseClass>Collection<BaseClass> is never substitutable for Collection<SubClass>Collection<SubClass>. This is because while the read facilities would be substitutable the write ones would not be. A Collection<SubClass>Collection<SubClass> can’t contain non-SubClass classes.

One approach for dealing with collections in general recommended in .NET Framework Design Guidelines is to expose IEnumeratorIEnumerator or IEnumerableIEnumerable interfaces rather than the collection itself — especially if you intend on it being read-only.

Piecing together Microsoft’s XNA gaming platform

I’ve briefly covered Microsoft’s XNA gaming platform before but have been trying to piece together what it is actually going to mean to developers.

Sorry, had to clarify the whole commercial/non-commercial parts. XNA Framework is just a portion of XNA… that won’t apply to the big guys.

Dell get pushy with insurance/extended warranties

  • đź“…
  • đź“ť 837
  • đź•™ 4
  • 📦 Hardware

We’ve all experienced the pushy salesman trying to get us to buy insurance/extended warranties when buying goods in stores but now it seems Dell are taking this to the extreme.

Last month we decided to buy my little brother a PC of his own and headed over to Dell and so my story starts.

Palm OS font available

My conversion of the Palm OS system font — as seen on the Palm Pilot — is now available for download. I’ve re-created the original 7 point normal font, the 7 point bold and the 11 point larger text from Palm OS screen-shots.

If you need a really small proportional font that’s nice to read this could be what you’re looking for.

Envy Code A & Code B programming fonts updated

This month has seen my Envy Code A and Envy Code B fonts stumbled upon some 4,000 times thanks to a Digg to Keith Deven’s programming fonts page that links here.

I’ve taken this opportunity to update the fonts — Envy Code B had a couple of issues with mis-positioned characters in the 9pt version especially with “il#” characters in the bold one. Fixed.

Substitutability of generic types in .NET

  • đź“…
  • đź“ť 504
  • đź•™ 3
  • 📦 .NET
  • đź’¬ 1

Anyone using object orientated programming soon finds themselves wanting to perform some action only if an object is of some type or implements some interface.

The easiest way is to do this is to use the isis operator. Typically it will appear something like: