Greg MacLellan

February 5, 2009

UPS Inefficiencies

Filed under: Rants — groogs @ 10:16 pm

I just wanted to make a small rant against UPS. Generally, UPS and most of the big shipping companies are known for their innovation and ever-lasting pursuit of efficiency. They have large computer networks to track shipments and deliveries and optimize routes.. fleets of hundreds of planes and thousands of trucks.. and can manage to get a box from one side of the continent to your front door on the other side in a day for less than the cost of fuel to drive a couple hours out of town.

And yet, even though I am basically never home during the day, I cannot get them to not try to deliver a package to my front door. They put my package on their truck, drive it to my house, and then drive around with it all day, before bringing it back to their warehouse, where they repeat the same process for the next two days. Finally, they leave it in their warehouse, and I can finally stop by after work to pick up the package.

I’ve previously emailed their customer center, and asked them if there is a way to set up my address so the package is always held. Apparently, this is not possible – the best I can do is open an account at a UPS Store, and then have it delivered there (which also means registering the UPS store as a valid shipping address on my credit card). I’m also assuming that opening the account is not free.. so I have to pay them for the privilege of not wasting their drivers time and gas attempting deliveries. That’s innovative.

To send it to my office, I have to add my work address as a shipping address on my credit card, and waste my co-workers time dealing with my personal shipments. This doesn’t really seem like the best way to handle this, although this is probably what I will do from now on.

Today, they’ve only tried to deliver my package once so far. I tried to request my package be held via their website (which both their website and phone system say is possible), but I simply cannot figure it out. I can track the package.. but even after creating an account, I see no way to modify anything about this shipment. So I gave up, and called the number on the notice they left me, again, and this time pressed 0 until it let me speak to a real person. (And then said yes about 8 times, because yes, I really do want to speak to a person.)

Finally the agent was able to stop them from trying to deliver.. maybe. It might have been too late, so they may try tomorrow again anyways. I asked if in the future, I could just call as soon as I got my tracking number. She admitted it would sound strange, but apparently, no. I can’t do this. They have to try to deliver it at least once first.

So even though this package gets from the other corner of the continent and across an international border in just over a day, it is doomed to be driven around in a truck pointlessly for at least two days, and stored in a warehouse over the weekend.

I must have a different definition of “efficient” than UPS does.

August 13, 2008

Inheriting constructors in C#, VB.NET

Filed under: Code,Rants — groogs @ 9:24 am

Several times, I’ve come across the need for inheriting constructors in .NET, and I am constantly annoyed that it does not work. I’m writing a business objects layer, and what I’m trying to do is create some constructors in the base class that can initialize the objects in many different ways, eg:

Public Sub New() ' Create new object using default storage
Public Sub New(ByVal storage as Storage) ' Create new object using specified storage
Public Sub New(ByVal conditions as String, ByVal parameters() as Object) ' Load an object by the specified query, using default storage
Public Sub New(ByVal storage as Storage, ByVal conditions as String, ByVal parameters() as Object) ' Load an object by the specified query
Public Sub New(ByVal id as Object) ' Load an object by the specified primary key, using default storage

And so on. I like to provide many different ways in the base classes, to 1) make writing the objects that inherit from this as easy as possible, and 2) make writing client code as easy and flexible as possible.

Unfortunately, since you cannot inherit constructors (except for the default New() constructor, if that is specified in the parent..), you cannot do this. You have to define stub constructors in each inherited object which call the parent constructor, which ends up being a whole bunch of copying and pasting, and even more work if you ever change/add a constructor.

Eric Gunnerson posted a blog entry about inheriting constructors, and there is a good discussion on it in the comments. I completely agree with Darren Oakey who suggests that constructors should be inherited if and only if no constructors are defined.

This fits in with the default behaviour of inheriting the empty constructor, and generally is compatible with existing code. The only time it would break existing code is if you have an object with no constructors that inherits from another with a non-default constructor, and you specifically want your inherited object to have the default constructor.

Public Class A
Public Sub New(ByVal value as Integer)
End Class

Public Class B
Inherits A
End Class

In the implementation right now, B only has the default (no parameters) constructor. If this change is made, B will have New(ByVal value as Integer), so existing code that assumes it has no parameters will fail. The fix for this is to explicitly define a constructor for B as:

Public Class B
Inherits A

Public Sub New()
End Sub
End Class

One of the arguments against inheriting constructors seem to be that implicit operations are bad and confusing – however, in my view, having the default constructor implicitly added in the above case is exactly the same thing. Additionally, as is pointed out in the comment thread in Eric’s post, this is also how methods behave. Why should constructors be different?

Another option is to add a class attribute that would allow constructors to be inherited, eg:

<InheritConstructors(true)> _
Class B
Inherits A
End Class

It would really make the language more powerful, and allow writing simpler and nicer code. In a simple example:

Dim cust as Customer = Customer.Load("id = {0}", 123)


Dim cust as New Customer("id = {0}", 123)

February 15, 2007

VoIP, Security systems, and FUD

Filed under: Rants,Telephony — groogs @ 1:31 am

I felt compelled to respond to an article NetworkWorld published (which made Slashdot) that talks about how VoIP and security systems are incompatible (as in home or business burglar alarms), and is apparently based on an article published by CBC. It does raise some valid points, but mostly it is sensational garbage.

First off, as the article correctly points out, VoIP does require power, so if you lose power, then you lose your phone line. This can be dealt with by getting a UPS (battery backup), and in fact, I’ve seen some providers that build batteries in to their modems/analog telephony adapters (though unfortunately, it’s not very common). It’s also true that your broadband connection is probably not as reliable as your PSTN lines – there are simply more things that can go wrong.

However, the article falls apart at this point, and starts arguing about how software changes to the security system could break everything (because on a PSTN they couldn’t? why are you upgrading your alarm system remotely/autonomously?), and how your TiVo, fax machine and conventional modem won’t work. I’m not quite sure what that has to do with security, nor am I sure why you’re using a conventional modem when you have a broadband internet connection.

The CBC article points out that one user went for a year and a half before noticing his alarm didn’t work. This is entirely his own fault. If you change your wiring, your service provider, or anything else, it’s just common sense to test the equipment hooked up to it. Surely if he added a new jack he would have picked up the phone to see if there was a dialtone instead of assuming everything worked. This is above and beyond the fact that most alarm systems suggest you test them at least monthly, ensuring that the sensors and sirens and phone connections are all working.

On a bit of a tangent, I’d also like to note how ineffective alarm signalling usually is: unconfirmed alarms are basically the lowest priority calls police will go on, so they often will not drive to your house until long after the alarm went off, if they even bother to show up at all. Here, the police charge businesses $60 for the second false alarm, $120 for the next, and so on (I’m not sure what they do for residences). Not to say that alarm dialing is useless, because the panic buttons should still get someone there pretty fast (it requires a human, as opposed to a motion sensor which can be a malfunction or pet), but if you think that the SWAT team arrives seconds after the alarm goes off with guns drawn, you’re sadly mistaken.

The best defence is to have neighbours that will hear your alarm going off (loud outdoor sirens help), notice the kids moving your big screen TV into a black van parked in the driveway, and call the police. Or get a big dog.

In my mind though, what these articles are really showing is how far behind the times everything else is. Yes, there are some major issues with VoIP that need to be addressed (911), but the benefits it has (the ability to have multiple phone numbers anywhere in the world, lower cost, multiple simultaneous calls..) are too much to ignore. To begin with, why don’t security systems call in periodically (weekly or monthly) to basically say “I’m alive!”? If they miss their call in, the security company can call the owner and say it missed its check-in. More sophisticated alarm systems usually have a special loop line, where the monitoring center actually sees immediately that they went offline, and can respond appropriately, this would be just a simpler version of that – although no emergency response would be mounted.Going forward, why are security systems still using phone lines? Why don’t they just get ethernet connections, and plug right into your broadband connection along with your PC? This would allow far more capabilities, including the constant monitoring mentioned above (but checking in every few seconds), remote access by the home owner, and the ability of the response center to save some money by ditching their banks of modems and PSTN lines in favour of running a few servers. Same thing goes for TiVos and satellite connections. To migrate existing non-ethernet devices, they could actually make another box that has an fxs port (which looks like a normal phone line to the TiVo) like a VoIP adapter, but actually be designed to emulate the head-end, and communicate via regular TCP/IP over the broadband connection back to the satellite/TiVo’s main office).

Based on the tone and conclusion (“But hardwired land lines seem to be the most solid answer for now anyway.”) of the original article, it sounds more like some Slashdot readers speculated – that the phone company is pushing for this drivel to be published because they’re starting to feel the sting of VoIP on their bottom line. I pay under $10 a month for my home phone service, have all the “features” that cost extra on PSTN lines, and can make multiple calls simultaneously if I want to – even a basic line with the telco is $25+, and if I were to get 4 or 5 lines with all the features active, I would be in the hundreds of dollars per month.

It would be great if the phone companies would leverage their existing (more reliable) network to basically run a second VoIP-only internet alongside the existing internet infrastructure, bringing the best of both worlds together – but unfortunately this will never happen because it would be too easy to use other providers, not pay outrageous long distance charges, etc.

June 9, 2006

Where did my insert key go?!?

Filed under: General,Rants,Technology — groogs @ 12:11 am

I spent some time recently trying to find a new keyboard, since my old one has had enough spilled on or in it over the years that it was uncleanable (still worked fine, but it was getting pretty gross). Now, I don’t know what keyboard designers are on these days, but they’ve made it an incredibly difficult and frustrating task.

What happened to the insert key?I don’t have any special keyboard needs, I usually just buy the basic el-cheapo keyboard that gets the job done. So I went down to my local computer shop, as I usually do when I need computer parts. It seems that somebody decided that the ‘insert’ key is no longer useful, so they removed it and replaced it with a gigantic delete key. Now, insert is probably one of those keys you use more than you think you do. If you spend any amount of time in vim, it’s something that will have you screaming bloody murder.

Do we really need a huge delete key?I then went to the big box stores thinking that I’d be able to find something with their larger selection. Although most of their selection was wireless, every single keyboard had some weird layout. The only ones that actually had an insert key were the ‘natural’ keyboards, unfortunately I can’t type on those, because I hold my arms at that ‘natural’ angle with a regular keyboard. When I use a ‘natural’ keyboard, I have to stick my elbows way out and it gets very uncomfortable.

Yes, that is a power-off button where page up should be.As I spent time looking at these keyboards, I also noticed some other trends, like weird function key groupings (see first pic above, where F1-F6 are on one side, and F7-F12 on the other, or the second pic, where they’re grouped by 3’s instead of 4’s). The absolute worst design has got to be the poor placement of power buttons. 15 minutes on of these keyboards and you’ll understand. I don’t know who decided to put a ‘power off’ button where ‘page up’ is supposed to be, but something horrible needs to happen to them.

You'd think these power buttons are small enough to be out of the way - they're not.It seems that keyboard designers have gotten bored or something, as they all love to mess with the layout of the cursor keys, insert/delete block, and function keys. Multimedia keys – even power buttons – are fine, but please just put them outside of the regular keyboard area!

I ended up buying a Logitech G15 (I’m sure I could have found and ordered a normal cheap one online, but hey, I was impatient that day), which is totally overkill for me since I don’t play games at all. I can’t even see the LCD, as it’s hidden under my desk because of the keyboard tray. I set up the programmable keys to open some commonly-used programs, but I rarely use them. What I do like about this keyboard though, is the backlighting (actually, that’s quite nice), the feel (light, but you know when you pressed a button), and most of all: it has an insert key.