Archive by Author
Microsoft Wireless Laser Desktop 7000
Posted on 19. Nov, 2008 by bryan.
I found it time to retire the venerable Microsoft Wireless Optical Desktop Elite made famous from the cover of Code Complete: A Practical Handbook of Software Construction:
At the time I purchased it, about 3 years ago, I believed it to be the cats meow of keyboards. And I was probably right. I usually am
. Anyway, enough self indulging. I tired of this keyboard this year, and when I saw the announcement for the Microsoft Wireless Laser Desktop 7000 I had to have one. But I didn’t have to have one for the original $129.99 asking price. Recently the price has dropped significantly under that original figure, and I was able to pull the trigger. Take a moment and marvel at the beauty of this thing:
Ewwww. You’re drooling. Here, let me help:
Okay. Enough gratuitous use of images. In any event, I have been very pleased with this keyboard all-in-all. I’ll give you the things I’m not crazy about first though:
- Out of the box, the rechargeable battery for the mouse didn’t work. So the theory is this desktop set comes with a mouse charger that you can plop that mouse on and recharge the battery. Seems like a great idea. Except when I put in the included rechargeable battery, and put the mouse on the charger, the mouse blinks fast red. Translation: Charging error. Solution? Drop a normal alkaline AAA in the mouse and throw the charger away.
- The cool "aero looking" plastic that surrounds the keyboard scratches VERY easily. So easily in fact that it comes pre-scratched from the factory.
- The escape key and other function keys are a bizarre size. Tiny little things. Although I still find them easy enough to hit.
- The space bar is a bit loud. Not necessarily on its own, but when compared to the amount of noise generated from the other keys on the keyboard, the space bar seems to generate twice as much noise. Not a big deal, just a small nitpicking thing. Its NOWHERE NEAR as loud as my Elite was!
Okay, now for the good stuff, things I like:
- Cannot be overstated – the thing is by far the best looking keyboard I have owned to date. Goes superbly with my Vista desktop. Very important.
- This thing is comfortable. I have been a latecomer to the whole curved setup of keyboards, but I purchased one of the Microsoft Wireless Laser Desktop 3000 kits for at work several months back and ever since I’ve found the normal "flat" keyboards just plain uncomfortable to type on. Furthermore, my typing speed seems to go up significantly on a curved keyboard.
- I really like the amount of pressure that each key requires. The Elite required a ridiculous amount of key pressure and I would find my fingers quite fatigued at the end of the day. I have not had any such problem with the Laser 7000.
- This is by far the best looking keyboard I have owned to date.
- People have complained about the new tiny 2.4 GHz USB receiver, but I actually like it. I’m tired of the big honking receiver that has come with previous keyboard sets. The reception is just fine at my desk, mind you my keyboard is within about 4 feet of the receiver, and I have it plugged into a USB port on the front of my desktop. Haven’t tried plugging it in the back, maybe I would run into problems then, but I doubt it.
Take my advice for what its worth, but if you are a fan of Microsoft hardware, which I undoubtedly am, I think you’ll be very happy with the Wireless Desktop Laser 7000.
Continue Reading
“The security validation for this page is invalid”
Posted on 18. Nov, 2008 by bryan.
I’m currently working on a SharePoint project that makes extensive use of programmatically setting ListItem ACL’s. There is a List Event Handler which sets ACLs on the ItemAdded event, but then there is an administrative interface that enables administrators to reassign list items to another user which effectively means replacing the ACLs for the ListItem to give another user Contribute.
In any event, I keep encountering the dreadful "The security validation for this page is invalid" error when trying to perform the ACL updates, specifically from web parts (haven’t seemed to have this issue on list event handlers). Well it appears that I’ve finally come up with the magic combination of fixes. There are several blog postings out there indicating that you should use "AllowUnsafeUpdates" on your SPWeb object. This seems to fix things for many people, however, the code I was working on calls "BreakRoleInheritance". Apparently that bugger ends up reverting the "AllowUnsafeUpdates" flag back to false after you call it!
Here’s the information that Paul Yau shared in a thread on the MSDN forums which took care of my issue, thanks for sharing Paul!
Problem Description:
===============
When you call SPList.BreakRoleInheritance(false) from an HTTP GET request, although you have specified SPWeb.AllUnsafeUpdates=true, you will still be thrown an exception
Updates are currently disallowed on GET requests. To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb.
Cause:
=====
This is by design limitation of SPList.BreakRoleInheritance
BreakRoleInheritance does it work in two steps. First, it needs to revert its permission to have same permission settings as parent (this is a less expensive operation, and give the list a fresh start on its road to unique permission). Later it checks CopyRoleAssignments parameter. If it is false, it takes an extra step to clean up permission on the list. A side effect of step 1 is that it dirties some internal objects in SPWeb, and cause them to be recreated. Unfortunately, the re-creation of those internal objects cause SPWeb.AllowUnsafeUpdates to have a default value which is false. That is, SPWeb.AllowUnsafeUpdates is reset in middle of call to SPList.BreakRoleInheritance, therefore we got the exception.
Resolution:
========
There are two possible workarounds to the issue:
1. Call SPList.BreakRoleInheritance from a HTTP POST request. That is, we can first have a button on UI and have users to click. In response to users’ click, we call SPList.BreakRoleInheritance. There is a first HTTP GET request by which, SharePoint has a chance to embed some digest to validate requests on return (HTTP POST). Therefore, we no longer need to set SPWeb.AllowUnsafeUpdates=true. This is recommended approach from security perspective.
2. First call SPList.BreakRoleInheritance(true). Then, use custom code to clean up permission and create your own permission set for the list as needed. The sample code are:
SPWeb web = SPControl.GetContextWeb(this.Context);
SPListCollection lists = web.Lists;
//Guid docLibGuid = lists.Add("Doc Lib Sample 1", "Doc Lib Desc", SPListTemplateType.DocumentLibrary);
//SPList docLib = lists[docLibGuid];
SPList docLib = lists["Doc Lib Sample 1"];
//docLib.ParentWeb.AllowUnsafeUpdates = true;
docLib.BreakRoleInheritance(true); //Exception throw here when the parameters is "false"
web.AllowUnsafeUpdates = true;
SPRoleAssignmentCollection roleAssigns = docLib.RoleAssignments;
for (int i = roleAssigns.Count-1; i >= 0; i–)
{
roleAssigns.Remove(i);
}
Continue Reading
PNY Attache 1G USB flash survives washing machine
Posted on 18. Nov, 2008 by bryan.
I’ve been in the habit the past few weeks of leaving items in my pockets which end up on an adventure through the washing machine. The latest participant was my PNY Attache 1G USB Flash drive.
I thought for certain it was a goner. I left it on my desk overnight to dry out and gave it a shot this morning, wha-la! Came right up with my Portable Apps menu. Very cool!
Continue Reading
Where is my storage space going?
Posted on 17. Nov, 2008 by bryan.
Over the past few weeks I have had several instances of where I need to know how where space is being allocated within a site collection. For instance, one client has seen tremendous growth of the site collection database, but is not sure how/where/why the space is being used. Another client has also seen rapid content database growth, and would like to make sure the space allocation is legitimate.
On the surface it did not appear that SharePoint had an out-of-the-box solution for this, which seemed criminal. A few products out there seemed to fill that void:
- Nintex Reporting (http://www.nintex.com)
- Quest Capacity Manager for Sharepoint (http://www.quest.com)
However, finally, today I came across a solution that IS right there out-of-the-box. While researching a completely unrelated issue, I discovered the _layouts/storman.aspx file, as referenced here. The trick is that you must have a site collection quota specified in order to use this feature. Once you configure a quota you will see "Storage space allocation" located under "Site Collection Administration" in Site Settings:
When you click on "Storage space allocation" you receive a page similar to the following (but without the huge black block protecting the innocent):
You can see that it shows the amount of space used in relation to the configured site quota, and then by default displays the amount of space being consumed by various document libraries in descending size! Fantastic!
Definitely not as complete as the Nintex or Quest Software solutions, but its great that there is in-fact an out-of-the-box way of achieving this.
Continue Reading
The SharePoint Development Tax
Posted on 04. Nov, 2008 by bryan.
Typically when you are talking about SharePoint the conversation revolves around all of the great "out of the box" functionality you receive with the product. In no way do I intend to argue against that, SharePoint is a fantastic product that does many things very well.
SharePoint as a development platform… well, that’s a whole different story! Jeffrey Palermo talks about it here, although his primary gripe seems to be that SharePoint has to run on a server OS, which would require using a development VM. I do all development in VMs regardless, so that isn’t really a deal-breaker for me at all. Speaking of which, Andrew Connell has a great blog posting on using differencing disks with Microsoft Virtual PC.
Charles Chen argues the opposite in his blog posting, defending SharePoint as a development environment and taking Palermo to task on a point-by-point basis.
One thing I don’t see mentioned by either is what I am going to refer to as the SharePoint Development Tax(tm). What is this tax? Is a break given to 95% of working families? Well, no. This tax comes in the form of time spent waiting for solutions to deploy, 12 hives to be copied, and app pools to be recycled. When working with SharePoint as a development environment, several times a day you will need to deploy solutions, which cause app pools to recycle, you may need to copy new assemblies to the GAC, again, requiring app pool recycles. So what’s so bad about that? That happens all the time in ASP.NET development, why is it bad for SharePoint? Well. The issue is HOW LONG SharePoint takes to recycle. Sure, you could complain about my development environment, but I am running on a quad-core 2.2 GHz machine with 8 GB RAM, and I give my development VPC 3 GB RAM. How long does it take? On average, a solution deployment takes 45-60 seconds. An app pool recycle takes almost 2 minutes. I probably go through about 10-20 app pool recycles a day, eating up 20-40 minutes of time, not to mention lost productivity due to falling "out of the zone". In Joel Spolsky’s famed blog posting 12 Steps to Better Code there are several mentions of how a 15 second break in concentration causes a 15 minute lapse in productivity.
Perhaps I should quit complaining though… The SharePoint Development Tax has given me lots of extra time to play guitar while watching spinning circle animations!
Continue Reading
Value does not fall within the expected range
Posted on 09. Oct, 2008 by bryan.
I’ve been battling this error several times over the past few weeks in varying contexts. Today’s occurrence was in accessing "Page Settings" of a MOSS Page. Thanks to YongYS for the following fix:
A few weeks ago I was running into this issue after backing up a content database and moving it to another farm. Thanks to Stefan Gossner to pointing out the error in my ways:
Continue Reading
Custom Workflows with Collect Data
Posted on 25. Jun, 2008 by bryan.
In the past week I have implemented several custom workflows for a client using SharePoint Designer. The workflows were pretty simple: A Forms Services form would be completed, in the form would be a the Manager’s name and e-mail address. The workflow would use the "Collect Data" action to perform an approval workflow, assigning an item to the manager specified in the form. Trouble was, the manager would receive the task notification, click the link in the e-mail to edit the task item, and receive an access denied error.
For the purposes of troubleshooting I opened the permissions on the task list as much as possible, granting nt authorityall authenticated users the Full Control permission. Still the users received "Access denied". Then, I found the following forum thread:
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1838253&SiteID=17
The solution wound up being a combination of two posts, this was by "Vansen":
I opened up the Site using the Sharepoint Designer. Then i right-clicked the workflows folder and chose properties. In the Security Tab i clicked the link "Manage Permissions using the browser". Then a new Browser window opened and i was able to adjust the rights for the Workflow Folder. In my case the rights inheritance was broken. I restored it and it worked.
And this one by "Andre Rentes":
I found a solution but not is the better…
-> Open Sharepoint Designer,
-> right click on Workflow 1 (My workflow)
-> select Publish Selected Files…
-> choose File System and write a location ( c: ) for example
-> Click OK
Combining these two solutions fixed all three of the problematic workflows! Thanks guys!
Continue Reading
Maintaining Other People’s Code
Posted on 01. Apr, 2008 by bryan.
I have taken over maintenance of other people’s code in the past, and its generally a mixed-bag. Sometimes you inherit a plate of spaghetti, sometimes you luck-out and actually get a well architected and implemented codebase. The real payoff when inheriting maintenance though, is to read the fantastic comments left behind, such as this gem I unearthed today:
// if it's a number we should sort it descending because it is probably a date // bad? no, this is AWESOME!!!! Regular expressions are for assholes. int.Parse(f.SubFolders[0].Name); dv2 = this.GetFolderViewSorted(f, "DESC");
Continue Reading
Logged in as System Account
Posted on 31. Mar, 2008 by bryan.
Had an issue today where a developer was testing a web part that required a user profile, and an exception was being thrown that the user profile did not exist. We verified in the SSP that the user profile indeed existed, and also used the "stsadm -o sync" command to force a profile synchronization. However, we discovered that SharePoint was not seeing the actual user name that the user was logged in as, instead SharePoint saw it as "SHAREPOINTSystem". This led us to the following forum thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1195418&SiteID=1
What ended up being the issue is that the developer had configured the SharePoint application pool to run as the same identity that he was logging into SharePoint as. We changed the configured identity in Central Admin -> Operations -> Service Accounts to use Network Service instead and the issue was resolved.
Continue Reading
Great new Visual Studio color theme
Posted on 28. Mar, 2008 by bryan.
The other day Tomas Restrepo released a new Visual Studio Color Theme called Distant Shores. It is a low-contrast theme with a dark background, and I must admit I am a BIG FAN! Have a look at the following screen shot. BTW – The font I am using is Damien Guard’s Envy CodeR font that Tomas Restrepo recommends in his blog posting.
Give it a shot! Your eyes will thank you!

