Next generation's garbage RSS 2.0
# Thursday, June 12, 2008

SharePoint advertises the fact that you can access files on a document library via WebDAV. This is done via \\{server}\{site}\{doclibname}\ and you can easily get to it with the list menu under "Actions", "Open with Windows Explorer". A lesser known fact is that you can also use WebDAV to access the attachments collection of a list with attachments enabled. This is done via \\{server}\{site}\Lists\{listname}\Attachments\{listitemid}\

You should be aware that the WebDAV folder for the list item will not exist until a file has been added to the attachment collection. If you need it to always exist, you can make an ItemAdded event handler that simply adds a file and deletes it, like this:

Public Overrides Sub ItemAdded(ByVal properties As Microsoft.SharePoint.SPItemEventProperties)
   Const tempFileName As String = "deleteme.txt"
   If item.Attachments.Count = 0 Then
      Try
         Me
.DisableEventFiring()
         item.Attachments.AddNow(tempFileName, System.Text.Encoding.ASCII.GetBytes("This is a temporary file. If you find it, please delete it."))
         item.Attachments.DeleteNow(tempFileName)
         ' Here we also save a WebDAV hyperlink
         Dim u As New Uri(item.Attachments.UrlPrefix)
         item("AttachmentsLink") = String.Format("file://{0}{1}, Attachments", u.Host, u.AbsolutePath))
         item.Update()
      Finally
         Me.EnableEventFiring()
      End Try
   End If
End Sub

In the code above, I also set a hyperlink field so the user has easy access to the WebDAV view of the list item. I simply added a hyperlink column called "AttachmentsLink" to the list.

If you are having trouble using the WebDAV access, be sure that your WebClient service is enabled and started, which is NOT the default on Windows Server 2003.

There is a series of ItemAttachment events available and as I mentioned before, the documentation for them is not very good. Hint: properties.AfterUrl will indicate the added file. .BeforeUrl will indicate the file being deleted.

BUG: The thing to watch out for is that when using WebDAV, the ItemAttachment events don't fire, but instead, an item event fires with .AfterUrl or .BeforeUrl set, which it wouldn't ordinarily -- you can use this fact to choose to reroute Item events to the appropriate ItemAttachment events in your event code. It would be nice if you could poke in the proper properties.EventType, but it's read-only so you need to make sure that any part of your ItemAttachment event code can handle that.

Public Overrides Sub Item{Whatever}(ByVal properties As Microsoft.SharePoint.SPItemEventProperties)
   ' Reroute for WebDAV event bug
   If properties.AfterUrl IsNot Nothing AndAlso properties.AfterUrl <> "" Then ItemAttachmentAdding(properties) : Exit Sub 'or ..Added( if -ed event.
   If properties.BeforeUrl IsNot Nothing AndAlso properties.BeforeUrl <> "" Then ItemAttachmentDeleting(properties) : Exit Sub 'or ..Deleted( if -ed event

   ' Normal event code follows

End Sub

Thursday, June 12, 2008 4:50:50 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
SharePoint
# Monday, June 09, 2008

VMware workstation allows a maximum of 950GB. That's quite a bit more than VirtualPC 2007 allows. So what's my advise on sizing? As before, do the max.

Windows Server 2003R2 install makes 1,637,548,032 byte .vmdk. Still under 8% difference.

"But I don't want to pay the extra 117MB." Really? That's pretty cheap compared to what the space required to install a partition resizer later along with your time.

"But I'm only going to use this virt for a couple of things." Great. Then when you are done and delete it, you'll get a full refund of your extra space.

"I don't want my virt blowing up my main machine by causing it to run out of disk space." You could enable disk quotas.

Monday, June 09, 2008 4:55:36 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
Virtualization
# Friday, June 06, 2008

Don't be a cheapskate when VirtualPC 2007 asks you how much disk space to allocate for your machine. Do the max! I just did a comparison of three identical installs of Windows Server 2003 on a 8GB, 64GB and a 132GB (which is the max) disks. The difference? Less than 2.5%. Here's the numbers:

8GB - 1,514,532,352 bytes
64GB - 1,537,721,344 bytes (22MB more)
132GB - 1,552,535,040 bytes (36MB more)

But why pay that extra space? If you ever had to grow one, you'd know why.

But why 132GB? I don't even had that much space on my drive? Sure, but the beauty of a virtual disk is that you can copy it off to another machine.

That's a key point: Your virtual machine may outlive your real hardware.

I'm gonna guess the difference on VMware is similiar.

Friday, June 06, 2008 6:20:00 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
Virtualization
# Thursday, June 05, 2008

It's not at all clear from the documentation nor is it logically located in the object model, but when you get a SharePoint attachment event (like ItemAttachmentAdding, ItemAttachmentAdded, ItemAttachmentDeleting, ItemAttachmentDeleted) you get the properties.Attachment collection, but the affected attachment is indicated by the properties.AfterUrl property which gives a web.Url relative url to the attachment being evented on.

Thursday, June 05, 2008 4:09:49 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
SharePoint
# Sunday, May 18, 2008
Sunday, May 18, 2008 5:36:17 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [1] -

# Friday, May 16, 2008

Not actually supported. You really need to -o backup your SC before you do it. If you didn't, try at least to backup your 12.0/Secure key in regedit and copy the \Windows\SysMSI\*\*.cer. The content is PKI protected. I've dorked up a WSS3 install royally this way.

Friday, May 16, 2008 12:11:30 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
SharePoint
# Wednesday, May 07, 2008

I've tried out the bus some more.

It has been an okay experience, but it would really make it more convenient if they had more buses with consistent routes. I should be able to plan my trip by looking at a map. I shouldn't have to consult a schedule and time trips and worry about missing a connection.

I was going to complain about busses that never came (twice), busses that came too early (as much as six minutes), busses that run too late (as much as 10 minutes) and make me miss connections, but all that would be no biggie if there were just more busses.

There's a built in inefficiency that comes from running on a schedule - the schedule has to be built on a timeline that the bus can usually keep up with, so that means that many times, the bus stops or drives slow so as to not run too early. Dumb.

They should just go as fast as they can with no fixed schedule and only try to to stay within some range of minutes behind the prior bus - only slowing down to prevent run-away delay where a late bus gets more late because so many people have stacked up waiting for it making for more stops on and off. Conversely, a fast bus keeps getting closer to the bus in front of him because he is less likely to need to stop to pick-up passengers and so becomes less likely to drop off.

A couple opportunities for optimization exist too. Often a bus stop is just after an intersection. If the bus is stuck at a red light anyway, it should offer to let people off there instead as long as there aren't any people waiting at the stop or bikes/wheelchairs needing to deboard. Also, there should be a way to indicate that I can get off at this or the next stop. If no one needs to get off at this stop, go ahead and skip it.

They have some routes with these long articulated busses. Why? Just run twice as many busses. It will make it more convenient and you can run them faster (because they carry half the passengers, they'll make fewer stops.)

I'm sure that Valley Metro has as many busses as they can afford (I think they're about half mill a piece), but I say that more people would ride it if they could rely on it and it had the same freedom of timing like driving.

I am annoyed by the stupid fare system:

  1. Why would anyone buy the 3 and 7 day local passes? They are consecutive day passes that are exactly 3 or 7x as expensive as a one day pass. I'm convinced this is some lame strategy for handling $5s, $10s and $20s - take their money and an extra $2.50 for not having exact change.
  2. Why can't I buy any number of one day passes? If all I have is a twenty when I walk up to a bus, I should be able to just get 8 one day passes with one being for today and the others for use any other day. Better yet, I get one card with 8 days loaded on it. For the holders info, the reader should mark the card to indicate days bought and a mark for each day spent so the rider can know when it'll be empty.
  3. Why can't I purchase and print passes online? Encode a number, print a bar code, sync numbers each night, if someone frauds it (prints and uses multiple copies), charge them or blacklist the card and name. You wouldn't be able to print and use for the same day, but that wouldn't be so bad - at least I'm not stuck waiting for the postal mail.

It's all pretty clearly set up to try to take your money. It's not even subtle. I suspect this has the opposite effect. Give someone a slight discount and the convenience and I think they'll buy more. I might not take the bus because I don't have exact fare. If I got, say, 10 one-day passes for $20, I would be encouraged to buy that for the discount and encouraged to use them because I have them already. (There's a natural decrease in perceived value of money already spent and so a higher readiness to spend it. It's why arcades use tokens.)

Finally, I'm annoyed by the handcuffed bus they're putting in. They call it light rail, but it's just a skirted trolley that's slower, has fewer stops, more expensive, isn't flexible and hogs two lanes of traffic 24/7. It also hoses up left turns and cross street traffic. And the price? 1.4 Billion! At 20 miles of track, that's over $1100 per linear inch. I think that's about $4.6 per square inch given two ten foot wide lanes. You could cover it in a three layers of twenty dollar bills for that money. According to their docs, expected ridership goes from 26,000 to 50,000/day over ten years - so over ten years, they'd have to charge every rider over $10 for each ride. I didn't count for interest because it is claimed that financing costs are part of the 1.4G$. I'm not sure this bargain counts for the operating cost. For the money you can buy busses for the length of the track. Not bus service, you could buy enough busses to park end-to-end for 20 miles!

Here are some others annoyed by light rail:

The ultimate answer? I'm imagining a system where people enter their start and end points and the system on the fly tries to fit you on a van-sized vehicle that's already going that way right now. Sort of a super traveling salesman type algorithm. No schedules, minimal stops, no transfers, very few empty miles. That would make for a cool simulation. It would essentially be like a cab, but without door to door service (traffic light worth streets) and with the expectation that it is shared but you wouldn't have to wait as long for it, it would cost a lot less and be more tree-huggie. The system could perform a cost analysis for each vehicle to carry the passenger to their destination (least wait, lowest transit time, lowest other passenger delay, lowest fuel costs which should make it avoid using empty or near-empty vehicles.) It should also optimize for refueling and operator breaks/shift-change. It should automatically account for wrecks, construction and other sorts of traffic delays. It should try to have the most route flexibility so it can broaden the on-the-way options. There will be a natural tendency for people to pre-book a little, but just give a cost for last minute cancellations, minimal waiting, and missed rides.

Edit: It's called DRT or Demand Responsive Transport (http://en.wikipedia.org/wiki/Demand_responsive_transport)

Wednesday, May 07, 2008 11:56:05 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -

# Friday, May 02, 2008

I just noticed that you can use a regular SharePoint calculated field to create a calculated Url or email address. If the result of your calculated field contains text that looks like a url or an email address, SharePoint will render it as such, <a> wrapping it. This is the same behavior as regular text fields. Nifty.

Friday, May 02, 2008 11:28:38 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
SharePoint
Archive
<June 2008>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345
All Content © 2008, Hafthor Stefansson - Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way. - Sign In