Steve Trefethen
Contact me Send mail to the author(s)
About Me
View my LinkedIn profile


Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?

Archives
Tags
Disclaimer
The posts on this weblog are provided �AS IS� with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer�s view in any way.
# Monday, June 16, 2008

Techmeme helping drive traffic to sensational c|net blog post

Posted @ 10:50AM

Categories: Soapbox

Tags:

How is it that blog posts like the one below from Matt Asay on c|net’s News.com can become a top headline on Techmeme? Is this sort of headline grabbing BS to be expected now that CBS owns c|net?Techmeme story 

I’m not going to do it justice by linking to it so if you want to you’ll have to search. I believe this story and headline were written for no other reason than to generate traffic for c|net. Mr.Asay is clearly out-of-touch with the Windows software development world if he actually believes the data he’s referring to. Couple that with the fact that companies like CodeGear and tools like Delphi can go a long ways towards alleviating the pain of moving to a new version of Windows by changing their runtime frameworks to help either adopt or mask the differences between versions allowing developers to continue to focus on the task at hand.

Fortunately, a number of comments in reply to the post are appropriately taking him to task. Of course, the downside of all this is that it accomplishes c|net’s goal of driving traffic to their site.

I’m not sure of the selection criteria for Techmeme but it just took a step down in my book.

# Sunday, June 15, 2008

Our G4 Mac Mini dies costing us $44 a month

Posted @ 10:11PM

Categories: Hardware

Tags:

In December, 2006 I bought a G4 Apple Mac Mini for my wife for Christmas and three days ago it died. It’s bad enough Apple came out with an Intel version within 4 or 5 weeks of my purchase but to have the thing die after 18 months makes it by far the most expensive computer I’ve ever owned based on of operation. That’s not to mention my wife used it maybe 15-30 minutes a day, if that. It’s not like it was running protein folding or some similar CPU intensive task rather it was in sleep mode the vast majority of the past 18 months.

And by died I mean pressing the power button does absolutely nothing. I’ve tried two different power supplies, resetting the PMU as well as taking out the RAM and re-seating it all to no avail. Yesterday, I took it to the Apple store Los Gatos where they told me "the worst case scenario for repair is $460.23" and that my only option is to authorize them for the worst case and they would charge me accordingly based on the type of repair required. They mentioned that if the machine had to be completely replaced the data on it would be lost, so I don’t even get the dead box back. Perhaps needless to say but I’m not going to go that route.

If anyone has suggestions for Mac Mini repair I’m all ears. I’ve read a few good things about DT&T in Fremont and that will likely be my choice unless I hear otherwise.

[Update: July 7, 2008] Here is how things turned out.

# Friday, June 13, 2008

Continuous Integration means developers doing command line builds

Posted @ 9:07AM

Categories: Continuous Integration | Tips

Tags:  | 

Building from the command line != building from the IDE

I just spent the last several hours fixing a large number of assembly references in a big C# solution. That means lots of errors like the following that leave you grep’ing your way through .sln/.csproj files to figure out what’s gone wrong:

Solution file warning MSB4051: Project {A9E00AF7-A1E0-4E65-90EF-CB66E8580
9AE} is referencing a project with GUID {958E0376-0272-4149-A1CF-E03521D12A72}, but a project with this GUID was not found in the .SLN file.

And builds stats that look like this:

CruiseControl.NET build statistics

Not good. It doesn’t help when VS.NET itself can cause these problems yet continue on blissfully. What I ran into today was a different reason for the same error message, this time around it wasn’t a missing "EndProject". The issue was that the second GUI was referring to a project that not only wasn’t in the .sln file but no longer existed. Regardless, the outcome was the same, building from VS.NET worked but executing MSBuild from the command line failed. WHY?! IMO, VS.NET should have failed just like MSBuild because it’s not doing you any favors when it doesn’t fail consistently along with MSBuild rather that’s just masking a problem. In addition, the error could be improved to show better information about the GUIDs that do reference a project rather than the GUID itself. I couldn’t agree more with Jeff Atwood’s post title The F5 Key Is Not a Bulid Process where he says:

If your "build process" is the F5 key, you have a problem. ...

Get your build process out of the IDE and into a build script. That’s the first step on the road to build enlightenment.

Amen.

Communicating Continuous Integration Requirements

If you’re chasing the holy grail of CI and working to get automated builds, test execution, static code analysis, build stats etc. make sure the developers working on the project understand the build requirements of your CI setup. In this case, building the main project is about as straight forward as it gets:

%SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild /t:clean mysolution.sln
%SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild /t:build mysolution.sln

Like I said, simple. Now, on the build server itself things aren’t quite this simple but for the bulk of the build if you get by this step you’ve gone a long way as it builds 22 C# projects. The first line above, that cleans the build is crucial. If you skip it and build from the command line after building in VS.NET you’ll continue masking the problem. A successful clean process is just as important as a successful build process. On this particular project there was a major project renaming that introduced a slew of errors but the VS.NET IDE sat idly by and in fact allowed this problem to occur. Eventually a checkin that trigger this set of failures occurred all the while "it builds fine on my machine".

The second problem was solution file name changes, copy/renames to be more specific, which further broke the CI build. The third problem was that the old .sln and csproj files were not deleted from the repository which led to even more confusion but I digress, that’s life in the real world, we fix it and move on.

# Thursday, June 12, 2008

System.Runtime.InteropServices.COMException loading a project into VS.NET 2008

Posted @ 11:14AM

Categories: Tips

Tags:

Recently, based on comments to this post I decided to turn Vistas UAC back on in "silent mode" using TweakUAC. Doing so allows me to run Windows Live Mesh to support folder synchronization which I’m now using to backup my blog content. The downside is that after making this change I started getting System.Runtime.InteropServices.COMException errors when loading a large application into VS.NET 2008.

System.Runtime.InteropServices.COMException
After a bit of head scratching I thought to change my VS.NET shortcut to launch with "Run as Administrator" enabled which resolved the error. Now, back to work!

# Tuesday, June 03, 2008

Facebook Starter Kit updated and available to install on Facebook

Posted @ 5:08PM

Categories: Facebook

Tags:

Here is an update for my Facebook Starter Kit for VS.NET 2008 which fixes the Invalid Parameter error in part by using the toolkits CanvasIFrame(...) base classes as well as adding the P3P header. These changes cleaned up the original code considerably making it much easier to read not to mention function properly.

FacebookASPNET available on Facebook

With this update I’ve added the application to Facebook as FacebookASPNET in case you want to add it to your Facebook account and play around. If you have feature suggestions or additions please let me know. At this point, the application is very simple but, of course, that was the point.

Lastly, if you monitor the RSS feed for the Facebook Developer’s Toolkit you already know about the pending 1.7 release as well as the pre-announcement of a 2.0 release which is great news and indicates the project is alive and well! Btw, I’ll be updating the Starter Kit as these updates come out but felt this change was significant enough to post now. If the 1.7 release comes out this week I’ll just update this post.

Let me know how it works. Thanks!

# Wednesday, May 28, 2008

Invalid Parameter Error using Facebook Developer Toolkit 1.6

Posted @ 11:49PM

Categories: ASP.NET | Facebook

Tags:  | 

[UPDATE: June 3, 2008] Problem solved.
I’ve been playing with a Facebook Application started using my Facebook Developer’s Toolkit Starter Kit (for v1.6) and I’m seeing an "Invalid Parameter" error which occurs if the application is left idle in the browser then an attempt is made to interact with the app and the session times out. The error is as follows:

Server Error in '/FacebookASPNET' Application.

Invalid parameter

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Facebook.Exceptions.FacebookException: Invalid parameter

Source Error:

Line 32:   else if (!String.IsNullOrEmpty(authToken))
Line 33:   {
Line 34:       _fbService.CreateSession(authToken);
Line 35:       Session["facebook_session_key"] = _fbService.SessionKey;
Line 36:       Session["facebook_userId"] = _fbService.UserId;

Source File: e:\web\nnn\htdocs\FacebookASPNET\Default.aspx.cs    Line: 34

Stack Trace:

[FacebookException: Invalid parameter]
   Facebook.API.FacebookAPI.ErrorCheck(XmlDocument doc) +900
   Facebook.API.FacebookAPI.LoadXMLDocument(String rawXML) +127
   Facebook.API.FacebookAPI.CreateSession() +92
   Facebook.Components.FacebookService.CreateSession(...) +37
   _Default.Page_Load(...) in Default.aspx.cs:34
   System.Web.Util.CalliHelper.EventArgFunctionCaller(...) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(...) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(...) +1436


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

The problem is discussed on the Facebook Developer’s Wiki here with the solution being to add the following code to allow for an IE issue regarding pages loaded in a frame from a different domain:

protected override void OnPreRender(EventArgs e) { Response.AppendHeader("P3P", "CP=\"CAO PSA OUR\""); base.OnPreRender(e); }

I’ve gone ahead and added this to my application but I’m still seeing this error. There are a number of discussions on the CodePlex project pages for the Toolkit related to this error message but AFAICT, it doesn’t appear this has been resolved at least not for IFRAME applications. In fact, the last message in this thread on the subject a user mentions switching to Facebook.NET which apparently doesn’t exhibit the same behavior. I haven’t had a chance to debug this further as I’m swamped with other work right now however, I thought it might be worth posting about to start gathering information about it. I’ll probably throw together a quick test using Facebook.NET for comparison and see what happens.

Anyway, have you run into this problem? Did the OnPreRender solution work? I’d like to update the starter kit as necessary to resolve this issue so if you have any details please let me know. Thanks!

# Monday, May 26, 2008

Poor man's guide to locking down Windows XP

Posted @ 9:57PM

Categories: howto

Tags:

A

while ago, I found myself sitting at my Mom’s Windows XP computer staring at your typical family tech support nightmare. A nephew had been given access to the machine from the admin account and the result, as you might expect, was a disaster. Of course, the conversation started with "Hey, do you think you could look at our computer it seems awfully slow?"

Some advice, if you ever hear this question and the machine has a broadband connection look for any possible means to change the subject and start packing the car!

After attempting as best I could to clean things up and having no desire to install any additional software for fear of exacerbating an already terrible situation I opted to create a secondary "nephew" user account I could attempt to lock down. Armed with Internet Explorer and Google I searched for ways to disable certain Windows features in an effort to try and "protect" the new account. My focus was only things I could do with the registry since, again, I didn’t want to install any software. Without further adieu here is the list of registry tweaks I found and used in no particular order.

WARNING: If you use and/or apply any of this information it is entirely your responsibility, you assume ALL risk. You’ve been warned!

Btw, here’s great guide to the Windows registry for reference though not all of these items came from that site.

Hide or Display Administrative Tools Menu
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
Advanced]
Value Name: StartMenuAdminTools
Data Type: REG_SZ (String Value)
Value Data: Yes or No

Hide Control Panel, Printer and Network Settings
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoSetFolders
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Disable Drag-and-Drop on the Start Menu
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoChangeStartMenu
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disable restriction, 1 = enable restriction)

Remove Run from the Start Menu
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoRun
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Remove Tray Items from Taskbar
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoTrayItemsDisplay
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = enable restriction)

Disable the Change Password Button
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
System]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
System]
Value Name: DisableChangePassword
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Disable the Lock Workstation Button
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
System]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
System]
Value Name: DisableLockWorkstation
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Disable System Restore Tools and Settings
System Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore]
Value Name: DisableConfig, DisableSR
Data Type: REG_DWORD (DWORD Value)
Value Data: (1 = enable restriction)

Disable the Ability to Right Click on the Desktop
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoViewContextMenu
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Screen Saver Password Protection Policy
User Key: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\
Desktop]
Value Name: ScreenSaverIsSecure
Data Type: REG_DWORD (DWORD Value)

Remove the Security Tab
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoSecurityTab
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = enable restriction)

Remove the Hardware Tab
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoHardwareTab
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = enable restriction)

Disable the New Menu Item
In the registry find this key [HKEY_CLASSES_ROOT\CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}].

Rename it by placing a dash "-" in front of the GUID (the long bracketed value at the end.

Disable the Ability to Customize Toolbars
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoToolbarCustomize
Data Type: REG_DWORD (DWORD Value)
Value Data: (1 = enable restriction)

Remove File Menu from Explorer
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoFileMenu
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Hide the Network Neighborhood Icon
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Value Name: NoNetHood
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disabled, 1 = enabled)

Avoid Accidental Registry Imports with Regedit
Open your registry and find the key below.
Change the (Default) value to equal "edit".
Exit your registry editor.

System Key: [HKEY_CLASSES_ROOT\regfile\shell]
Value Name: (Default)
Data Type: REG_SZ (String Value)
Value Data: edit

Disable Windows Installer
System Key: [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
Value Name: DisableMSI
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = admin only, 2 = disabled)

Restrict Installations from Removable Media
User Key: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Installer]
Value Name: DisableMedia
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = enable restriction)