AWG Blogs

Tuesday, August 24, 2010

ORM LINQ Style

I'm rediscovering LINQ, and came across this article - http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx - by Scott Guthrie (probably not the first time I've read this article).

Ever wonder why arrows seem to point in the opposite direction in E-R diagrams? This paragraph explains it. It ties in well with O/RM, in that the mapped objects will be composed of their children. I always tended to look at it in the direction of the diamond head as more intuitive speaking of foreign keys and all.

The arrows between the four entity classes above represent associations/relationships between the different entities. These are typically modeled using primary-key/foreign-key relationships in the database. The direction of the arrows on the design-surface indicate whether the association is a one-to-one or one-to-many relationship. Strongly-typed properties will be added to the entity classes based on this. For example, the Category class above has a one-to-many relationship with the Product class. This means it will have a "Categories" property which is a collection of Product objects within that category. The Product class then has a "Category" property that points to a Category class instance that represents the Category to which the Product belongs.

Sunday, August 8, 2010

I Discover DCI

I just now discovered DCI; see http://www.artima.com/articles/dci_vision.html

All I can say is, it's about freakin' time! For too long we programmers have struggled with staying true to OO, but faltering because as a model OO does not provide an adequate place to store algorithms. That's why of late, I have been putting the algorithms in stored procedures. Hey maybe that's a DCI best practice! Too early to tell. Hopefully a language comes out that supports DCI.

BTW, is Trygve Reenskaug a god or what?

Saturday, July 31, 2010

Controller Example

Found a good example of the notion of controller of the MVC:

they handle web requests and URLs of the request map to a controller class and a closure within the class
http://grails.org/Quick+Start

Essentialy it's the thing you need (generated automatically in this case, i.e. grails) to map a URL, crafted according to the conventions of the current framework in use, to a desired output. So http://localhost:8080/my-project/book/list maps to an output containing a list of book items.

Sunday, July 25, 2010

Using WDS for VMware Server Deployment

The goal was to follow this excellent walk-through -- http://www.oakdome.com/lab/?page_id=78 -- to capture and deploy a Windows XP image (as a test) from and to a guest in the free VMware Server.

Everything went real well except for a few stumbling blocks.

First, I found out through much googling that it's acceptable, even preferred to run the WDS on a separate server than the DHCP server. Perfect. My DHCP server is a CISCO router anyway. For some reason I thought they had to be on the same server and a Windows one at that.

Then, I had to setup the guest to use the right nic. Again, I found out that I need to run Manage Virtual Networks as Administrator (on Vista) or else the Automatic Bridging options are greyed out.

Then I learned through a few threads on social technet that the reason the Windows Deployment Services Image Capture Wizard would freeze after checking the Upload image to WDS server checkbox and entering the server name is because the network connection is not setup. I hit shift-F10 and did ipconfig, and there was no network. The solution is to export the currently loaded boot image from the WDS to a temp directory. Then make sure you have WAIK (for Vista) installed on the WDS or another server to which you copy the wim file image. Then copy all the files from C:\Program Files\VMware\VMware Tools\Drivers\vmxnet to c:\temp\vmxnet. Then C:\Program Files\Windows AIK\Tools\PETools>imagex /mountrw c:\capture\capturebootimage.WIM 1 c:\image
Then
C:\Program Files\Windows AIK\Tools\PETools>peimg /inf=c:\temp\vmxnet\*.inf /image=c:\image\Windows
Then C:\Program Files\Windows AIK\Tools\PETools>imagex /unmount /commit c:\image
Then copy back the image, and reimport it into the boot images of WDS, naming it something like "Boot image with VMXnet drivers." Then when you PXE boot choose that image from the menu.

This same process has to be done for the deployment image. But this time, since you are using the Vista boot image, the command has to be run from a Vista or later OS apparently, or else you get PEIMG failed to complete the operation with status code 0x800703fb. when attempting to inject the drivers. I managed to inject the drivers by installing WAIK on a Windows 7 Ultimate VM, with VMware tools installed, from which I injected the vmxnet drivers. Be sure to do c:\windows\system32>imagex /mountrw c:\temp\boot.wim 2 c:\image -- Note the "2." Evidentally, there's a second image in the boot.wim that came with the Vista sources, which contains the WDS image. Note that the boot.wim file was copied from the Vista 32 DVD sources NOT the Windows 7 sources. The latter will not work.

Tuesday, July 6, 2010

Set clientJsLocation when using HTML_AJAX in XAMPP

Please remember to set clientJsLocation, e.g.:
$server->setClientJsLocation('C:/xampp/php/PEAR/data/HTML_AJAX/js/');


Or else, you will get an error like: Unable to find javascript file: .\pear\data\HTML_AJAX\js\HTML_AJAX.js

HTML_AJAX 0.5.6 with XAMPP 1.7.3.

The only thing I can think of that causes this is reinstalling HTML_AJAX-beta via pear install? Otherwise, I guess it's understand we should always set the path. Now you know. (speaking to self)

Friday, July 2, 2010

WSS 3.0 Incoming Email -- Must use FQDN

I wanted to be able to send email from my Outlook to a WSS discussion list. After much testing and troubleshooting with various configurations (and a lot of googling) I came to realize that (barring any workarounds that I'm not aware of) the CA - Operations - Incoming E-Mail Settings - E-mail server display address MUST match the machine FQDN! It cannot be the machine's DNS name. I tried adding the DNS name of the machine here, and email would just get bounced back (or get stuck in the Queue since I didn't have the smart host configured and this is not an Exchange server).

So as a result, I can send email using discussions@mymachine.fq.dn -- but NOT discussions@mymachine.dns.name.

I'm sure there are workarounds, but they might involve fiddling with Exchange servers and/or DNS servers that are outside of my control.

Now that I think about it, it makes sense that the WSS doesn't understand the DNS implications; why should it? On the other hand, why can't WSS figure out that mymachine.dns.name is the local server? Hmmmmm. Perhaps it's an IIS 6 SMTP limitation...

Saturday, June 5, 2010

MyEDB - NO Indexes to be Managed

This is because in My Entity Database all Entities are defined in a single index table called entity, which provides the link between the types and properties. The actual values of an entity reside in type tables which themselves are all indexed on their value column.

So, no indexes to add and manage. That eliminates probably 50% of a DBA's duties...

ref: http://myedb.blogspot.com/2010/06/myedb-no-indexes-to-be-managed.html