Sunday, January 25, 2009

NHibernate + GoDaddy

NHibernateGoDaddy By default NHibernate does not play nice with medium trust web host such as GoDaddy. In the case of NHibernate and GoDaddy you can get it up and running if you follow a few simple conventions listed below. 

1. Make sure all the properties and FIELDS of your entities are marked public.
2. Set lazy to false in all of your class mappings.
<class
   name="User"
   table="User"
   lazy="false">
3. Turn NHibernate optimizer off.
<hibernate-configuration
   xmlns="urn:nhibernate-configuration-2.2">
    <reflection-optimizer
       use="false" />

Wednesday, November 12, 2008

Scrum Meetings

AgileDevelopment

We started with scrum meetings this week and so far it has worked out well. Typically scrum is a daily 15 minute meeting. Each team member reviews yesterdays task, today's task, and what is holding them up. Instead of holding a meeting each day we decided that each team member can answer their questions and send it in the form of an email. Each morning team members fill in this form letter email and fire it off to the team.

  • What have you done since yesterday?
  • What are you planning to do by today?
  • Do you have any problems preventing you from accomplishing your goal?

So far this is working extremely well! We are all informed of roadblocks, who is working on what and what is left to reach our goals. This is our first step in adopting the agile development process. When it is all said and done I am hoping this will lead to an attractive "after" photo of our development process.

Wednesday, May 28, 2008



I finally got HTTP POST working properly using the iPhone SDK. I am posting login credentials to an HTTP service (signin.aspx) which will return a session token embedded in xml. the result is in the xml format <result>token</result> The code below simply performs the post and then uses xpath to parse the token out of the xml.

- (NSString*)signIn
{
NSError *error;
NSURLResponse *response;
NSData *dataReply;
NSString *stringReply;
NSString* content = @"userName=admin&password=abc123";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: @"http://example.com/api/signin.aspx"]];
[request setHTTPMethod: @"POST"];
[request setHTTPBody:[content dataUsingEncoding: NSASCIIStringEncoding]];
dataReply = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
stringReply = [[NSString alloc] initWithData:dataReply encoding:NSUTF8StringEncoding];
NSError *err=nil;
NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithXMLString:stringReply options:NSXMLDocumentTidyXML error:&err];
if (xmlDoc == nil) {
if (err) {
[self handleError:err];
}
return nil;
}
if (err) {
[self handleError:err];
}

NSXMLElement *thisToken;
NSString *token = nil;
NSArray *nodes = [xmlDoc nodesForXPath:@"./result" error:&err];

if ([nodes count] > 0 ) {
thisToken = [nodes objectAtIndex:0];
token = [thisToken stringValue];
}

if (err != nil) {
[self handleError:err];
}
[xmlDoc release];
[stringReply release];
return token;
}

Next task is to get the same code working using SSL.

Saturday, May 3, 2008

Microsoft MVC

I want to learn more about Microsoft MVC for ASP.NET. I have worked with Java Struts which is an awesome MVC frameworks. I my experience I believe that MVC is the way to go on large multipage products but maybe not so for small two to five page projects. Well, I am gonna dig in and see if MS' MVC stacks up to what I have worked with in the past.

Wednesday, March 12, 2008

Have we coded this before?


How would you like to search your whole source code repository as easy as you can search the web with Google? In most of our code reviews we discover some snippet of code that has been reproduced yet again in our code base. You and I already know this is a waste of time and money. It is a waste in development cycles and sometimes more of a waste in maintenance cycles. So we needed an answer and before trying inventing yet another tool it is always best to ask Google. I asked, and was introduced to Koders. Koders is exactly what I was looking for. I downloaded the trial and no joke in 20 min I had a search engine strapped on top of our code base. We are using subversion and all I had to do was install the KodBot crawler and then point it to our repository. I played with it a little and sent an email to Koders asking a few questions about pricing and security and got a response in a few hours. To say the least I am very impressed and see us adding this tool to out utility belt. For more info visit http://www.koders.com/ install it yourself and let me know what you think.

Labels:

Sunday, March 9, 2008

Woe is UAC (during updates anyway)


I've got several clients using Vista and my application automatically updates itself. This would be fine and dandy, but they need the application installed in “Program Files”. On top of that (here's the kicker), they DO NOT want the users to have to be an "administrator" or "power user". After further digging I uncover that is is cool for the administrator to perform the initial installation but, it is not cool for the administrator to be required to trek around the office keying in credentials during updates. I realize this is a case of wanting your cake and eat it too but it doesn’t change the fact they are asking for it. My knee jerk reaction to this is to respond with “No, you do not want to do this, this is a bad idea”. But in reality this can make sense in some environments.

So it boils down to this question. Under Vista and UAC, how can I have an administrator install an application in "Program Files" and then days later the application auto updates without being logged in as an administrator?

Here is “one” solution to the problem:
  • The administrator performs the installation and his credentials are stored off (encrypted and with consent, of course)

  • Days later the application starts an update process.

  • The application starts an intermediate process with a run-as command with the saved credentials.

  • The intermediate process must NOT require administrative privileges or the run-as precess will fail silently.

  • The intermediate process then starts a third process that DOES require administrative privileges.

  • A elevation prompt is invoked and the user must click's "Allow".

  • Now the update can begin with administrative privileges

This is allot of extra clicks for the non-administrator, but at least she will not have to wait for administrator to drag in to work and cruise around to 49 other pc's waiting to update before she can get updated and start work.

Other Solutions:
As with most things this is not the only solution to this problem. If you do not like this solution here are some other path you can research.
  • Make your installations and updates as MSI's then set a group policy to allow non-administrators to perform installation. I really like this solution and may revisit it but it does not work if you updates are not based on MSI's (like mine). InstallAware has some good information on this subject. [link]

  • If Program Files is not a requirement the sky is the limit consider using Click Once or installing you application in the user data folder.