| | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| 28 | 29 | 30 | 31 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 | | 11 | 12 | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | 23 | 24 | | 25 | 26 | 27 | 28 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Subscribe to this feed:
|
|
Archives:
| May, 2010 (1) |
| March, 2010 (1) |
| November, 2009 (1) |
| September, 2009 (1) |
| July, 2009 (2) |
| June, 2009 (1) |
| May, 2009 (1) |
| March, 2009 (5) |
| February, 2009 (3) |
| July, 2008 (1) |
| June, 2008 (2) |
| May, 2008 (1) |
| April, 2008 (2) |
| March, 2008 (4) |
| February, 2008 (4) |
| December, 2007 (2) |
| October, 2007 (2) |
| September, 2007 (1) |
| June, 2007 (1) |
| May, 2007 (4) |
| April, 2007 (4) |
| March, 2007 (2) |
| February, 2007 (4) |
| January, 2007 (3) |
| December, 2006 (1) |
| November, 2006 (4) |
| October, 2006 (7) |
| September, 2006 (2) |
| August, 2006 (14) |
| July, 2006 (9) |
|
LifeCycle regularly uses FxCop to check our code for conformance to the Microsoft Patterns & Practices Design Guidelines. This tool analyzes an assembly against rules governing good naming, security, and performance. Where a problem is found, FxCop gives you a link to more MSDN guidance on the issue. Not only a great quality assurance tool, but a good learning tool as well. But on the horizon are a crop of new code analysis tools that take the concept to the next level. CodeIt.Right takes a similar approach- analyzing code and providing a list of violations. However, CodeIt.Right also bakes in refactoring. Not only does it tell you your Serializeable type should inherit ISerializable, but with one click, it will make the fix for you. NStatic analyzes code and reports on violations in an extremely readable graphical overlay displayed ontop of your code. As far as I can tell, the violations it targets tend to be more subtle flaws in logic within procedures. Neither is ready for prime time- CodeIt.Right is in beta and was a little buggy in my testing and NStatic isn't available to the public at all yet. Still, if your interested in writing quality code, these are two products to keep bookmarked.
So, our Action Pack came this week, and I installed Office 2007. I'm loving the sleek new ribbon UI goodness, but one thing was bugging me in Outlook 2007's email editor. When composing a new email, the font size looked way too big. It was set to Tahoma 10, and when I sent the message, it looked fine. Not a huge problem, but I want WYSIWYG! I Googled, but apparently I'm the only one picky enough to care. It turns out it's zoomed to 200% by default, but the zoom tool isn't there! To fix: Outlook -> New -> RT Click top of ribbon -> Customize Quick Access -> Customize -> All Commands -> Zoom -> Add The zoom button should appear in the top left. Then click inside the message, click the zoom button, and choose 100%. Seems like this could be a problem if users crank their font down when composing, and send tinsy little hard-to-read emails.
Scott Guthrie has a new post with a nice 25 minute video introduction into the next version of Visual Studio, showing off the almost fully-baked LINQ-to-SQL functionality with an ASP.NET example. I can't wait to code this way!
Microsoft Office SharePoint Server 2007 utilizes the "master page" concept familiar to ASP.NET 2.0 developers -- a big improvement in the latest SharePoint release. Developers wishing to create a custom look and feel for a SharePoint site will probably first open SharePoint Designer and begin dissecting, changing and discarding parts of the default master page ("default.master"); however, it doesn't take long to discover that this is not a trivial process and that removing the wrong ContentPlaceHolder tags renders some of the default pages inoperable. This is due to the fact that pages inherting the "default" master page expect certain ContentPlaceHolder tags to be available in the base page. Microsoft has published a How-To document with a code sample that provides a minimal master page which contains all the basic pieces need to have a functioning site. While this code snippet is a good start, it appears that MS left out the following ContentPlaceHolders:
<asp:ContentPlaceHolder ID="PlaceHolderBodyRightMargin" runat="server"/> <asp:ContentPlaceHolder ID="PlaceHolderTitleRightMargin" runat="server"/>
If you experience error messages with the standard SharePoint pages after using the "minimal" template, try adding these placeholders.
One of the reasons I prefer C# to VB.Net is for its brevity (not true in every case, but generally so). Adding to the list of its syntax shortcuts, C# 2.0 introduces a new operator: "??", dubbed the "null coalescing" operator. For you SQLServer gurus out there, it is somewhat analagous to the COALESCE() function in Transact-SQL...it evaluates a single value and returns a second value if the first value is null (note, the type involved must be nullable).
string customerName=null; string newCustomerName=null;
// a long way of assigning newCustomerName if (customerName == null) { newCustomerName = "Empty"; } else{ newCustomerName = customerName;}
// a slightly shorter approach, using ?: "ternary operator" newCustomerName = (customerName == null ? "Empty" : customerName);
// much more concise, using the new ?? operator newCustomerName = customerName ?? "Empty";
More information here.
FogBugz is a great web-based project management and bug tracking application that we use to keep track of our customer's projects. I'm often suprised by the quality and modern feel of this app, despite running in classic ASP*. So I was pleasantly suprised again when I found they'd come out with an API and Visual Studio 2005 Plugin. Installation was simple, and the result is a very Team System-ey integration between our helpdesk and development environment. *As a side note, it's actually written in a proprietary language, Wasabi, which has driven some to (perhaps rightly) question the owner.
Here's one feature of ASP.NET 2.0 you may not have heard of- I certainly hadn't until it hit the blogs again recently. If you drop a file named app_offline.htm in your web application's root folder, then all requests to that application will only return that file. Very handy for scheduled downtime, bringing down your app for updates, etc. Scott Guthrie mentions the trick here, as well as a minor issue to be aware of when designing your app_offline page. One novel way to implement this is to integrate it into your deployment process. For example, a simple batch file like this: copy C:\MyCompany\app_offline_updating.htm C:\InetPub\wwwroot\Demo\ProjectName\app_offline.htm /y xcopy C:\MyCompany\ProjectName*.* C:\InetPub\wwwroot\Clients\Demo\ProjectName\ /s /q /y del C:\InetPub\wwwroot\Clients\Demo\ProjectName\app_offline.htm The batch file can be run manually, or even better- as part of your continuous integration process. With a little javascript or meta-tag to do automatic refreshes, this is a great way to avoid errors and communicate downtime to users.
If you're not familiar with Cruise Control .NET, it's a continuous integration server for .NET projects. What's a continuous integration server? Well, think of it as a free developer. It's job description is not enviable: - Wait for new code to be checked in by the other developers and make sure it can be compiled.
- Check the code for best practices.
- Run unit tests to make sure nothing is broken.
- Perform any last minute tasks
- Notify team members of the latest changes.
- Alert the appropriate people if something fails.
If you think about it, this is really a fitting analogy. FXCop ensures your code conforms to a large chunk of MS Patterns & Practices. With NUnit, you write tests to check some part of your code. This is the same as asking another developer to double-check everything for you. Finally, MSBuild and CC.NET tasks pick up a ton of other tedious tasks such as deploying a setup package, notifying people of changes, updating the company website, etc. What this means is that the real developers can focus on the fun stuff: writing code, while "the new guy" does the grunt work.
In our ongoing effort to share with you tools that we find useful, here's a throwback to the days of yore:
PowerGREP is a grep-like tool
for Windows that allows you to search (and replace) regex patterns in
folders (and their subfolders). My favorite feature of the
product is that it will allow you to preview replacements before
commiting them. It's also very fast.
Good utility to have in any toolbox.
I'm posting this mostly because I know I'll forget, but hopefully it'll come in handy for others as well. One tricky problem in programming is to search by date range against data that also has a date range. Sounds simple, but this can quickly get confusing. You must take into account the start and end date of the search criteria, as well as the start and end date of the data. You must also consider cases where the start date is in the given range, but the end date is not, or visa-versa. Then there are cases where neither are in the search range. See, confusing. (Ryan Farley has a good illustration of it all, and is where I finally found my answer) It helped me to think of it in terms of a timeline, and the search as simply finding the records where the search range intersects with the record range. As one of the commenters on the above post pointed out, it's easier to exclude the records that don't match. In a SQL, it'd look something like this: SELECT * FROM Reservations WHERE (NOT((ReservationEnd < @StartDate) or (ReservationStart > @EndDate))) In plain english: Get the records where the reservation does not end before the start date, or start after the end date. One other gotcha. Be sure, when passing the start and end dates into your SQL query from .NET, that you're considering time as well. Typically, you'll want to search from 12AM to 11:59PM: Dim startDate As DateTime = New DateTime(CurrentDate.Year, CurrentDate.Month, 1, 0, 0, 0) Dim endDate As DateTime = New DateTime(CurrentDate.Year, CurrentDate.Month, DateTime.DaysInMonth(startDate.Year, startDate.Month), 23, 59, 59)
|