David Foderick's Blog - OnMaterialize()

January 2006 - Posts

SoCal Code Camp 2006 Session Content

Code Camp was a great success! Thanks to everyone who attended my sessions. Click on the following links to download the associated code.

*Note: The sample project requires DLINQ (installs with LINQ). DLINQ is beta software!

Introduction to the Composite UI Application Block (slides, code, sql)
This session introduces the CAB and its associate design patterns, including Inversion of Control, Dependency Injection (ObjectBuilder), lightweight containers and the .NET Component Model. The code includes my custom CAB application that uses DLINQ for object persistence.

DLINQ: The future of .NET Data Access (slides, code, sql)
This session is a short introduction to O/R Mapping and the current capabilities of Microsoft's DLINQ project.

Code Camp Session: DLINQ, the future of .NET Data Access

Yeah! The Code Camp Session with the pompous title!

DLINQ is Mircrosoft's latest attempt (anyone remember ObjectSpaces?) to conquer (some would say stub their toe on) Object-Relational Mapping. Well, here it is another new year and hope springs eternal. This session covers ORM basics and shows some of what DLINQ can do. I plan to show SQLMeta reverse engineering a database and then write some simple code to materialize and persist the resultant business objects. Come enjoy the spectacle.

Get the content.

Code Camp Session: Introduction to the Composite UI Application Block

For anyone attending Code Camp this weekend, I will be giving a session on the Composite UI Application Block, or CAB, as it is affectionately known. The CAB is an application framework for creating modular plug-in UI's. The cool factor here is that CAB is built upon Microsoft's Dependency Injection (DI) framework called ObjectBuilder. Dependency Injection allows you to create loosly coupled plug-in components. The CAB is specifically built for Windows Forms UI's under .NET 2.0. It takes advantage of generics, DI and eventing between modules.

Get the content.

Study links for 70-529 : .NET 2.0 Distributed Application Development

Skills measured by exam 70-529

Creating and Accessing XML Web Services
Create and configure an XML Web service method.
Create a public method.
Attach the WebMethodAttribute attribute.
http://msdn.microsoft.com/msdnmag/issues/02/11/XMLFiles/default.aspx
Create a OneWay Web method.
Configure a Web service method.
   
Configure a Web service method by using the properties of the WebMethodAttribute attribute.   
Use discovery files to publish a list of Web services that are installed on a Web server.   
Build and deploy a Web service application.  
Configuring and Customizing a Web Service Application
Configure SOAP messages.
Configure the formatting of SOAP messages for a Web service method.
Specify the basic information for a Web service application.
Specify the bindings of a Web service application by using the WebServiceBindingAttribute attribute.
Configure a Web service application by using a Machine.config file.
Configure a Web service application by using a Web.config file.
   
Configure the Web services communication protocol.
Select the formatting of SOAP messages.
Specify the parameter formatting.
Specify the parameter style.
   
Manage session state in Web services.
Implement session state by using the Application object.
Implement session state by using cookies.
Implement session state by using the Session object.
   
Implement SOAP headers.
Add a custom SOAP header class.
Create a public instance of the custom SOAP header class in a Web service class.
Apply a SoapHeader attribute to a Web method.
Access and process a SOAP header in a Web method.
Set the direction of a SOAP header.
Handle unknown SOAP headers.
   
Implement SOAP extensions.
Create a custom SOAP extension.
Configure a SOAP extension.
Process a SOAP header in a client application.
   
Creating, Configuring, and Deploying Remoting Applications
Create and configure a server application.
Create a server application domain.
Configure a server application programmatically.
Configure a server application by using configuration files.
Compile and build a server application.
   
Create a client application to access a remote object.
Create a remote object.
Configure a client application programmatically.
Configure a client application manually by using configuration files.
Access the remoting service by calling a remote method.
Call a remote method synchronously in a client application.
   
Debug and deploy a remoting application.
Use performance counters to monitor a remoting application.
Debug a remoting application.
Host and deploy a remoting application.
   
Create and serialize remotable types.
Create a remotable type.
Create generic types.
Configure a serialization formatter programmatically.
Configure a binary formatter.
Configure a SOAP formatter.
Implement Version Tolerant Serialization (VTS).
   
Manage the lifetime of remote objects.
Initialize the lifetime of a remote object.
Renew the lifetime of a remote object.
   
Implementing Asynchronous Calls and Remoting Events
Call Web methods asynchronously.
Call a Web method.
Poll for the completion of a Web method.
Get Web method results.
Implement callback.
Call a OneWay Web method.
   
Call remoting methods asynchronously.
Implement one-way methods by using the OneWay attribute.
Call a remote method asynchronously.
Implement callback.
   
Implement events in remoting applications.
Create and fire events.
Implement event handler for the events of a remote object.
   
Implementing Web Services Enhancements (WSE) 3.0
WSE 3.0 on MSDN
Enable WSE in client and server applications.
Enable WSE in client and server apps
Add references to WSE assemblies in client applications.
Edit the Web service proxy class to derive from the WebServicesClientProtocol class.
Add a soapExtensionTypes element under the webServices element in a configuration file.
Add a configSections element to add the microsoft.web.services3 section to a configuration file.
   
Add a digital signature to a SOAP message and verify an existing SOAP message signature.
Sign a SOAP message digitally.
Verify a signed SOAP message.
   
Encrypt and decrypt a SOAP message.
Encrypt decrypt soap message
Encrypt a SOAP message.
Decrypt an encrypted SOAP message.
   
Implement a policy for a Web service application.
Create a policy file manually.
Declare the set of policies in a policy file.
Map policies to SOAP endpoints.
Configure a policy file in a configuration file.
Create and enforce a custom policy.
Create a policy file by using the WseConfigEditor3 tool.
Set a policy in a client application and in a client computer.
   
Implement filters in a Web service application.
Add a filter.
Remove a filter.
Shuffle the order of the filters.
Enable the Trace filter.
Create custom input and output filters.
   
Implement WSE SOAP messaging.
Select a protocol.
Implement one-way SOAP messaging.
Implement bidirectional SOAP messaging.
Send the attachments from a Web service application.
Receive attachments in a client application.
   
Route SOAP messages by using a WSE router.
Route SOAP message using WSE router
Create a WSE router application.
Configure a WSE router application.
Configure a referral cache for routing.
   
Add and verify security credentials.
Add and verify security credentials
Add security credentials to a SOAP message.
Verify security credentials.
   
Creating and Accessing a Serviced Component and Using Message Queuing
Create, configure, and access a serviced component.
Create a serviced component.
Add attributes to a serviced component.
Register a serviced component.
Implement security.
Add a reference to a serviced component in an application.
Create an instance of a serviced component.
Call the methods of a serviced component.
   
Create, delete, and set permissions on a message queue.
Create a message queue manually.
Create a message queue programmatically.
Delete a message queue.
Set permissions for a message queue programmatically.
   
Send messages to a message queue and delete messages from a message queue.
Create a message.
Post a message.
Receive a message synchronously.
Decide which formatter to use.
Read a message body.
Delete queued messages.
  
Sign and encrypt messages.
Sign a message.
Encrypt a message by using UseEncryption and EncryptionAlgorithm properties.
Handle acknowledgments.
  
Receive messages.
Peek at messages.
Enumerate messages.
Receive a message asynchronously.
Use BeginReceive/BeginPeek methods.
Respond to a ReceiveCompleted or PeekCompleted event.
  
Process messages.
Verify a message source by using a certificate.
Decrypt a message.
Extract response queue details from a message.
Compose and send a response to a response queue.
Apply a rule to a message queue. 

Additional Links
http://www.mtelligent.com/display/ShowJournal?moduleId=489404&currentPage=2&categoryId=36818

ypops: free pop3 access to yahoo mail

I don't begrudge a corportation making an honest buck, but if yahoo is going to inject spam into my email messages then I don't think I should have to pay for it. If you have a yahoo email account then you know that if you want pop3 access you've got to pay for it... until now.

YPOPS give you free pop3 access to your yahoo mail and so far it works great. Just download the software, run it and you can start getting your yahoo email in Outlook Express. Here's a neat trick to install ypops on your home server and use the email client remotely:

1. Install ypops normally.
2. Bind ypops to the network card's ip address, not the internal (127.0.0.1) address
3. * Open ports 25 and 110 in your firewall
4. Configure your server's public ip address as the incoming and outgoing mail server

* Note: If your ISP blocks port 25 (as mine does) then choose another port to host your service.

Now, if I can just figure out how to run ypops as a service...

Sargagility != Shagability

If you ever write SQL queries you should know about sargability. Sargable (Search-Argumentable) refers to the ability of a database server to optimize the execution of SQL statements by using indexes. The ability to write sargable predicates (conditions in the where statement) is the crux of a database application that performs well.

In general (and at the risk of oversimplifying the issue), you should strive to write your where conditions in the form FIELD sargable-operand VALUE, where FIELD is some indexed field and VALUE is some constant. Some sargable operands include =,<,>,>=,<= and BETWEEN. When at least some of the conditions are sargable, SQL can use indexes on the table to efficiently find the results; otherwise it has to scan the table for data (which involves reading data pages into memory).

The most common place where programmers get into trouble is dealing with dates, especially when removing the time portion of a date. Specifically, writing a query with an expression on the left side of a condition renders it non-sargable. For example, WHERE CONVERT(char(8), datecol, 112) = '20061010' cannot be optimized because of the CONVERT function on the left. Rewrite the query like this to make it sargable: WHERE datecol >= '20061010' and datecol < '20061011'. Note the < in the second part of the condition.

And how do you know that the query is using an index? Simply showing the execution plan in Query Optimizer and hovering your mouse over the node that executes your query will show any indexes involved in the query plan.

On a humorous note, when researching sargability, google suggested I look for shagability! Well, I guess a query that is sargable is also shagable in my book.

To find out more, this is a really good reference on all aspects of datetime fields in sql server and here is a link for more information on sargable.

Hacking the cable modem

I've been a cable modem user since at least 1998 when I was using a Com21 modem in Miami Beach. My only other modem (until yesterday) was a Toshiba PCX1100 that I got when I moved to the OC. For the last couple of months the Toshiba has been having problems losing the connection quite frequently. After googling for a while and reading other people's trials and tribulations with the Toshiba and Cox and acknowledging that I got the modem in 2001 and it is now 2006, I decided to upgrade my modem.

When buying a cable modem you want to make sure it is on your ISP's compatible modem list. Also, there is a standard of interoperability for cable modems known as DOCSIS. Make sure your modem supports the latest Docsis version (currently 2.0, but 3.0 is in the works).

Most cable modems will have a web server that is available at http://192.168.100.1/ . Go ahead. Try it now. My Linksys cable modem gives me status, connection and log pages.

The most important information (subjectively speaking) is on the connection page. It shows me the provisioned rate which is the maximum speed that the provider (COX) allows for my connection in both the downstream (downloading) and upstream (sending) directions. You can also baseline the power levels to monitor, diagnose and troubleshoot your own connectivity issues. Finally, the log gives you important information to monitor QOS.

For those of you who want to go deeper, there is a DOCSIS Cable Modem Diagnostics program available here.

Finally, you will probably want to measure and monitor your actual bandwidth throughput by browsing to some of these bandwidth mesasurement pages:
http://reviews.cnet.com/7004-7254_7-0.html
http://www.bandwidthplace.com/speedtest/
http://www.dslreports.com/stest

And don't forget that many cable providers will sell you increased bandwidth for a price. If you buy the premium faster service make sure to look at your cable modem's connection page to see if the provisioned rate has increased.