Tuesday, January 27, 2009

Temporal Data Techniques in SQL

Timestamps, holidays, etc., written by a member of the SQL-92 standards committee. Maybe coulda used this at Rockwell!

Monday, January 19, 2009

THE PALM PILOT AND THE HUMAN BRAIN

Interesting...

Part I.

and Part II.

Jeff Hawkins' web site is here: http://www.onintelligence.org/

Microsoft Naming Conventions

"The general format for a namespace name is as follows:

<Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>]

For example, Microsoft.WindowsMobile.DirectX."

Sunday, January 18, 2009

Economy Made Few Gains in Bush Years

"President Bush has presided over the weakest eight-year span for the U.S. economy in decades, according to an analysis of key data, and economists across the ideological spectrum increasingly view his two terms as a time of little progress on the nation's thorniest fiscal challenges."

And yet there are those who will worship Dubya until the day they die. How can you take seriously any supposedly religious person who believes that Dubya was sent by God? Maybe he was sent by God to punish us for something -- like to punish us for voting Republican.

Friday, January 09, 2009

Developing a use case document, looking for guides or software to help

On StackOverflow.com, someone asked about a good reference guide and templates for writing use cases. The person with the best answer talked about Alistair Cockburn, and mentioned this document as well, which I haven't read yet: http://www.bredemeyer.com/pdf_files/functreq.pdf

Thursday, January 01, 2009

Friday, December 19, 2008

My first WSCF web service project. Contract first, code later.

We're using WSCF (Web Services Contract First) 0.7 at work, and this guy published a review of an earlier version (0.5). He loved it except for the following, which might be different in 0.7, but I haven't checked yet:
"So far using WSCF for building the web service is quite a success. But I did not use it for building the consuming client. My main problem was that every roundtrip of the contracts requires deploying (plain copy) the generated wsdl and the accompanying schema's to the client code. Instead I created just a server project which included the contract schema's. One clean and independent project. As all info needed by a consumer of the service is in the wsdl all the consuming client application needs is a reference to the wsdl. Which is exactly what add web reference in VS does. Having updated the service all I need to do in the client project is Update Web Reference. However, the proxy generated by WCSF does offer some nice extra's. It returns the data (when the option in the wizard is set) as a collection, the VS web reference just sees an plain array. I also have to set the service endpoint (the URL with it's location) by hand. The latter is something I'll have to do anyhow, as it will be read from a config file. And I can live with the arrays as a trade off for a cleaner development process. This is a point where WSCF could be improved."

Monday, December 15, 2008

LINQ support on .NET 2.0

Oh thank god!!!

I'm working in a shop with ancient servers which run only .NET 2.0, so this is a wonderful thing to know about. Woo hoo!

Here's what he has to say:
  1. "Create a new console application
  2. Keep only System and System.Core as referenced assemblies
  3. Set Copy Local to true for System.Core, because it does not exist in .NET 2.0
  4. Use a LINQ query in the Main method. For example the one below.
  5. Build
  6. Copy all the bin output to a machine where only .NET 2.0 is installed
  7. Run"


[Update Apr 2 2009: This didn't work for me because our server was using .NET 2.0 without SP1. Instead, I used the excellent LINQBridge.]

Tuesday, November 25, 2008

Monday, November 24, 2008

Google Advice for writing testable code

From Miško Hevery's blog:

Warning Signs

  • new keyword in a constructor or at field declaration
  • Static method calls in a constructor or at field declaration
  • Anything more than field assignment in constructors
  • Object not fully initialized after the constructor finishes (watch out forinitialize methods)
  • Control flow (conditional or looping logic) in a constructor
  • Code does complex object graph construction inside a constructor rather than using a factory or builder
  • Adding or using an initialization block

Flaw #2: Digging into Collaborators

Warning Signs

  • Objects are passed in but never used directly (only used to get access to other objects)
  • Law of Demeter violation: method call chain walks an object graph with more than one dot (.)
  • Suspicious names: contextenvironmentprincipalcontainer, or manager

Flaw #3: Brittle Global State & Singletons

Warning Signs

  • Adding or using singletons
  • Adding or using static fields or static methods
  • Adding or using static initialization blocks
  • Adding or using registries
  • Adding or using service locators

Flaw #4: Class Does Too Much

Warning Signs

  • Summing up what the class does includes the word “and”
  • Class would be challenging for new team members to read and quickly “get it”
  • Class has fields that are only used in some methods
  • Class has static methods that only operate on parameters"

LINQ Reference Documentation

From Charlie Calvert's Community Blog:

"The LINQ documentation created by Microsoft is available both inside Visual Studio, and for free via the MSDN library found on the WEB. Here are some important pages from that documentation that can help you navigate through the online reference material that Microsoft has prepared for LINQ developers:

· The Root MSDN Library Page: http://msdn.microsoft.com/en-us/library/default.aspx

· .NET Development: http://msdn.microsoft.com/en-us/library/aa139615.aspx

· .NET Framework 3.5: http://msdn.microsoft.com/en-us/library/w0x726c2.aspx

· System.Linq: http://msdn.microsoft.com/en-us/library/system.linq.aspx

· System.Data.Linq: http://msdn.microsoft.com/en-us/library/system.data.linq.aspx

· System.Xml.Linq: http://msdn.microsoft.com/en-us/library/system.xml.linq.aspx

· Code Generation: http://msdn.microsoft.com/en-us/library/bb399400.aspx

· More on Joins: http://msdn.microsoft.com/en-us/library/bb311040.aspx

· For more information on the operators, see the section of the online help called “The .NET Standard Query Operators.” It is written by Anders Hejlsberg and Mads Torgersen. The URL is http://msdn.microsoft.com/en-us/library/bb394939.aspx

I would not suggest using these references materials as a primary means of learning LINQ. However, if you have a book or other guide to LINQ development, then this reference material can be a useful addendum to that text. If you understand in a general way how LINQ works, but need answers to detailed questions, the links provided here may sometimes help you find answers."

Saturday, November 22, 2008

Money-Saving Meal Plans at Whole Foods

Advice for constructing a menu for the week, from Whole Foods. Kind of a cool idea!

Wednesday, November 19, 2008

How To: Use Impersonation and Delegation in ASP.NET 2.0

Has an API to login as a different user. See also this link: How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA

And this link: Encrypting configuration files using protected configuration, to avoid the dreaded "The RSA key container could not be opened" error. It tells you to encrypt using this command:
aspnet_regiis -pa "NetFrameworkConfigurationKey" "ASPNET"

So, for example, to encrypt user identity (in one line):
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pa "NetFrameworkConfigurationKey" "ASPNET" -pef system.web/identity C:\Inetpub\wwwroot\SimpleEmailWebService


The relevant code is this:
    // From http://msdn.microsoft.com/en-us/library/ms998351.aspx

public class NativeWindowsSecurity
{
// Declare signatures for Win32 LogonUser and CloseHandle APIs
[DllImport("advapi32.dll", SetLastError = true)]
public static extern bool LogonUser(
string principal,
string authority,
string password,
LogonSessionType logonType,
LogonProvider logonProvider,
out IntPtr token);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool CloseHandle(IntPtr handle);

public enum LogonSessionType : uint
{
Interactive = 2,
Network,
Batch,
Service,
NetworkCleartext = 8,
NewCredentials
}

public enum LogonProvider : uint
{
Default = 0, // default for platform (use this!)
WinNT35, // sends smoke signals to authority
WinNT40, // uses NTLM
WinNT50 // negotiates Kerb or NTLM
}
}

Saturday, November 15, 2008

CSU Library Research Databases

  • EBSCOhost Research Databases: Menu of databases provided through EBSCO Publishing.
  • Business Source Complete (1886- some full text): Index, abstracts, and full text covering scholarly business journals on management, economics, finance, accounting, international business and much more.
  • Wall Street Journal (1984-): Contains full text articles from the Wall Street Journal from January 2, 1984 through today's issue. Browse issues, or search for terms in citation, abstract, or article text.
    • Use keyword search on:
      • your company
      • supply chain
      • logistics
      • quality
      • strategy
      • etc

Wednesday, October 29, 2008

VS 2008 Nested Master Page Support

Scott Guthrie has this to say about VS 2008 Nested Master Page Support:
"The good news is that VS 2008 fully supports nested master pages, and makes using them super easy. Going forward I recommend that almost all ASP.NET projects should advantage of this feature - since it can add tremendous flexibility to the UI of your projects."

Also mentions Open Source Templates.

Tips for Nested Master Pages and VS 2005 Design-Time

From Scott Guthrie. He has sample code to get around the problem of nested master pages not being editable in the visual designer. (Emphasis added.)
"One of the cool advanced features of the new Master Pages feature in ASP.NET 2.0 is the ability to nest them. For example, you could define a top-level master-page called “MainMaster.master” that defines a common logo header and footer, and defines a content-placeholder for the page called “content”. You could then define two sub-masters beneath it – one that provides a two-column layout model for the content (“TwoColumnMaster.master”), and one that provides a three-column layout model (“ThreeColumnMaster.master”). These two nested-master pages could then use the MainMaster.master file as the root master, and only adjust the layout within its content section (each would fill in the "content" placeholder and in turn add their own content-placeholders for sub-pages within it). The benefit of this approach is that if a designer ever changed the logo or top-level design of the site, they only have to update one file (MainMaster.master) and then have every page on the site automatically pick it up regardless of what master file they were based on.

"This nested model is pretty cool and powerful, and allows arbitrary levels of nesting. The only downside is that VS 2005 only supports nested master page editing in source-view, and doesn’t support it in the WYWSIWYG designer (note: obviously it does support editing them when the master-pages are not nested). "

Tuesday, October 28, 2008

Cool way to style HTML forms using CSS

Interesting article at Webmonkey. Uses things I've never heard of, including <fieldset> and <legend> tags, and using unordered lists and stylesheets to style the forms.

Saturday, October 25, 2008

CMS Ratings

This article publishes ratings of many different open source CMS systems.