We often blame managers for schedule pressure. We often complain that our companies set unreasonable deadlines and have unrealistic expectations. This might be true, but it's only half the problem. The other half, the most important half, is within us. We consider our worth as programmers to be more associated with speed than with quality. And that's a tragedy; because it leads us to create messes. It leads us down the slower path. By rushing we ruin our chance to truly go fast.
Wednesday, January 27, 2010
Quality vs. Speed
This article from Uncle Bob is a few years old, but it's message is timeless: The Tortoise and the Hare. An excerpt:
Friday, January 15, 2010
SQL Server 2008 install gotcha
Warning for when you install Microsoft's SQL Server 2008.
If you plan to connect to the database server from a different machine using the network, you will need to enable the TCP/IP protocol. To do that you need to run the SQL Server Configuration Manager under Microsoft SQL Server 2008 -> Configuration Tools. Then select SQL Server Network Configuration. Right click on TCP/IP and select Enable.
Hours of frustration just avoided.
If you plan to connect to the database server from a different machine using the network, you will need to enable the TCP/IP protocol. To do that you need to run the SQL Server Configuration Manager under Microsoft SQL Server 2008 -> Configuration Tools. Then select SQL Server Network Configuration. Right click on TCP/IP and select Enable.
Hours of frustration just avoided.
Labels:
"Connections_Refused",
SQL Server 2008
Wednesday, January 6, 2010
"Connections_Refused" error in IIS logs.
We had a production issue other day for some reason IIS was not responding rest all other services are working great, we are able to login to production box, stop and start services but IIS was not responding. We checked individual component memory use, process, and recycled MSDTC, restarted IIS, didn't help any of these, so restarted the server. Later everything came back to normal.
After sometime, another production box behaved similar, we quickly restarted the server, problem solved.
Later one of our testing team member reported that one of testing server is not responding. Instead of restarting the server, we decided to take testing server take out from cluster and started investigating the problem.
We started looking into EventLog all sources, IIS logs, System activity logs, and all our custom log entries in DB. No luck. Nothing suspecious.
We thought take a deeper looking to IIS logs once again and we found a lead, this time, below are the details.
The following errors were found in the httperr3.log on
applicationServer1:
2009-12-03 12:49:41 - - - - - - - - - 3_Connections_Refused
-2009-12-03 12:49:46 - - - - - - - - - 1_Connections_Refused
-2009-12-03 12:50:41 - - - - - - - - - 3_Connections_Refused
-2009-12-03 12:50:46 - - - - - - - - - 1_Connections_Refused –
… many similar lines follow.
The httperr1.log file on ApplicationServer2 contained the following:
2009-12-03 12:13:41 - - - - - - - - - 3_Connections_Refused
-2009-12-03 12:13:46 - - - - - - - - - 1_Connections_Refused
-2009-12-03 12:13:56 - - - - - - - - - 2_Connections_Refused
-2009-12-03 12:14:46 - - - - - - - - - 4_Connections_Refused
-2009-12-03 12:14:55 - - - - - - - - - 1_Connections_Refused –
… many similar lines follow.
Microsoft KB 934878 at http://support.microsoft.com/kb/934878 identifies this error log message specifically, and says: “This issue occurs if less than 20 megabytes (MB) of nonpaged pool memory is available on the server. When less than 20 megabytes (MB) of nonpaged pool memory is available, the Http.sys kernel mode driver stops accepting new connections.” Our application servers in the Test environment were affected in an identical way, with the same messages in the log files, so we were able to isolate and diagnose the problem further. It turns out the Mitsubishi DiamondLink Remote Agent seems to have a slow memory leak in the kernel’s nonpaged memory pool. During the failure in the Test environment, this process was seen to be using almost 95 Megabytes of memory (see the screenshot below). Once this process was killed, IIS began accepting connections again.

We have also tracked the nonpaged memory usage for the DevManRA process on a still operational server over the course of an hour. During this time, the memory consumption can be seen increasing by about 345 K:

Given these conditions, we concluded that the DevManRA.exe process consumed enough nonpaged memory in production this morning to cause IIS to reject all new connections. In this case, rebooting the server would fix the problem as the DevManRA process would be recycled and would start consuming memory again from zero.
After sometime, another production box behaved similar, we quickly restarted the server, problem solved.
Later one of our testing team member reported that one of testing server is not responding. Instead of restarting the server, we decided to take testing server take out from cluster and started investigating the problem.
We started looking into EventLog all sources, IIS logs, System activity logs, and all our custom log entries in DB. No luck. Nothing suspecious.
We thought take a deeper looking to IIS logs once again and we found a lead, this time, below are the details.
The following errors were found in the httperr3.log on
applicationServer1:
2009-12-03 12:49:41 - - - - - - - - - 3_Connections_Refused
-2009-12-03 12:49:46 - - - - - - - - - 1_Connections_Refused
-2009-12-03 12:50:41 - - - - - - - - - 3_Connections_Refused
-2009-12-03 12:50:46 - - - - - - - - - 1_Connections_Refused –
… many similar lines follow.
The httperr1.log file on ApplicationServer2 contained the following:
2009-12-03 12:13:41 - - - - - - - - - 3_Connections_Refused
-2009-12-03 12:13:46 - - - - - - - - - 1_Connections_Refused
-2009-12-03 12:13:56 - - - - - - - - - 2_Connections_Refused
-2009-12-03 12:14:46 - - - - - - - - - 4_Connections_Refused
-2009-12-03 12:14:55 - - - - - - - - - 1_Connections_Refused –
… many similar lines follow.
Microsoft KB 934878 at http://support.microsoft.com/kb/934878 identifies this error log message specifically, and says: “This issue occurs if less than 20 megabytes (MB) of nonpaged pool memory is available on the server. When less than 20 megabytes (MB) of nonpaged pool memory is available, the Http.sys kernel mode driver stops accepting new connections.” Our application servers in the Test environment were affected in an identical way, with the same messages in the log files, so we were able to isolate and diagnose the problem further. It turns out the Mitsubishi DiamondLink Remote Agent seems to have a slow memory leak in the kernel’s nonpaged memory pool. During the failure in the Test environment, this process was seen to be using almost 95 Megabytes of memory (see the screenshot below). Once this process was killed, IIS began accepting connections again.

We have also tracked the nonpaged memory usage for the DevManRA process on a still operational server over the course of an hour. During this time, the memory consumption can be seen increasing by about 345 K:

Given these conditions, we concluded that the DevManRA.exe process consumed enough nonpaged memory in production this morning to cause IIS to reject all new connections. In this case, rebooting the server would fix the problem as the DevManRA process would be recycled and would start consuming memory again from zero.
Adding events to outlook calendar
'Save following code to .vbs file.
const ALL_DAY = 1440 '60 minutes/hour * 24 hours/day
const WORK_DAY = 480 '60 minutes/hour * 8 hours/day
AddCalendarItem "Family Day", "", ALL_DAY, #2/15/2010#
AddCalendarItem "New Year’s Day", "", ALL_DAY, #1/1/2011#
Wscript.Echo "Holidays have been imported."
Sub AddCalendarItem(subject, body, duration, start)
Const olAppointmentItem = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
objAppointment.Start = start
If 1440 = duration Then
objAppointment.AllDayEvent = True
Else
objAppointment.Duration = duration
End If
objAppointment.Subject = subject
objAppointment.Body = body
objAppointment.BusyStatus = 3 'OOO
objAppointment.Save
End Sub
const ALL_DAY = 1440 '60 minutes/hour * 24 hours/day
const WORK_DAY = 480 '60 minutes/hour * 8 hours/day
AddCalendarItem "Family Day", "", ALL_DAY, #2/15/2010#
AddCalendarItem "New Year’s Day", "", ALL_DAY, #1/1/2011#
Wscript.Echo "Holidays have been imported."
Sub AddCalendarItem(subject, body, duration, start)
Const olAppointmentItem = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
objAppointment.Start = start
If 1440 = duration Then
objAppointment.AllDayEvent = True
Else
objAppointment.Duration = duration
End If
objAppointment.Subject = subject
objAppointment.Body = body
objAppointment.BusyStatus = 3 'OOO
objAppointment.Save
End Sub
Tuesday, December 8, 2009
Sunday, December 6, 2009
NHibernate for Windows applications
Check out Ayende's excellent MSDN article on using NHibernate in Windows apps...
Tuesday, December 1, 2009
Recovering a lost VMWare datastore
In case anyone else runs into this...
We have a VMWare ESX Server (version 3.5) that's has a a 2TB iSCSI datastore that hosts a handful of VMs. Well, today the VMWare server got rebooted, and afterwards all of the VMs in that datastore showed up as "inaccessible". And the event log had some messages like this:
Uh....panic?
Anyway, the resolution is to follow the (not obvious to me) steps in this post: http://theether.net/kb/100026. Thank you, thank you, thank you. The datastore has been recovered with the VMs intact.
We have a VMWare ESX Server (version 3.5) that's has a a 2TB iSCSI datastore that hosts a handful of VMs. Well, today the VMWare server got rebooted, and afterwards all of the VMs in that datastore showed up as "inaccessible". And the event log had some messages like this:
LVM: 4476: vml.[big long number]:1 may be snapshot: disabling access. See
resignaturing section i ([bunch of numbers])
Uh....panic?
Anyway, the resolution is to follow the (not obvious to me) steps in this post: http://theether.net/kb/100026. Thank you, thank you, thank you. The datastore has been recovered with the VMs intact.
Thursday, November 5, 2009
Linq and MySql Coolness
I have been messing around with this cool framework called IQToolkit. I was able to get some simple CRUD running against MySql pretty quickly. The code is database independent so you can change the App.Config to say SQLLite without any code changes and it just works.
It is short on simple samples so here is what I threw together playing around. You can get the code here.
Saturday, June 27, 2009
Simple .Net Rules Engine
I just posted the start of a project on google code. It is posted under the New BSD Licence. If anyone is interested in contributing send me an email. The code is http://code.google.com/p/simple-rules/
Snippet...
Snippet...
Employee.Rules
.Add( "Terminate all hourly employees" )
.When( Employee.is_hourly )
.And( Employee.is_active )
.Then( Employee.terminate );
Labels:
dsl,
fluent interface,
rules,
validation
Monday, March 23, 2009
Saturday, February 14, 2009
LINQ To SQL Automapping
I had tried to use LinqToSql before on a project and found that is was pretty cumbersome. I do still try to learn as much as possible concerning this topic when I can given I normally use NHibernate and am pretty happy with it. I get tired of all of this extra crap I have to do... Doesn't matter which framework I am using.
So I was messing around this evening (working on a small sql scripting utility) when I realized you can query from SqlServer using LinqToSql and Poco's and no presupplied mapping information. You just create a data context, connect to the database, build your poco and tell the datacontext to get you some data for the given object. It automatically takes care of the mapping for you.
I was pleasantly surprised when I realized this. Though I have not tried to do any inserts or updates as of yet, using the data context in this way, it does work great for queries. I am querying the information schema views from SqlServer to load database information for scripting operations and it is a breeze.
Now the hard part. How to turn these table objects into something that I can load the actual table data into... Reflection Emit anyone?
Suggestions would be great...
So I was messing around this evening (working on a small sql scripting utility) when I realized you can query from SqlServer using LinqToSql and Poco's and no presupplied mapping information. You just create a data context, connect to the database, build your poco and tell the datacontext to get you some data for the given object. It automatically takes care of the mapping for you.
I was pleasantly surprised when I realized this. Though I have not tried to do any inserts or updates as of yet, using the data context in this way, it does work great for queries. I am querying the information schema views from SqlServer to load database information for scripting operations and it is a breeze.
Now the hard part. How to turn these table objects into something that I can load the actual table data into... Reflection Emit anyone?
Suggestions would be great...
Labels:
database,
DataContext,
LINQ,
LinqToSql,
Scripting
Tuesday, November 18, 2008
Typing skills
I've said in the past that my most valuable high school class was typing. It looks like Jeff Atwood would agree. And I agree with him that programmers should strive to be efficient typists.
But I won't go so far as to agree that "coding is just typing", even jokingly. Too many people believe that programming is a mechanical process, and we can't reinforce that mistaken belief. Coding is hard, typing isn't.
UPDATE: Check out Jimmy Bogard's thoughts on this: "We’re thinkers first, coders second." Yes.
But I won't go so far as to agree that "coding is just typing", even jokingly. Too many people believe that programming is a mechanical process, and we can't reinforce that mistaken belief. Coding is hard, typing isn't.
UPDATE: Check out Jimmy Bogard's thoughts on this: "We’re thinkers first, coders second." Yes.
Friday, November 14, 2008
Kanban in a Small Team
A couple of us (myself included) recently had the opportunity to attend KaizenConf. It was, in a word, amazing. We brought back a whole lot of stuff from the conference, but the one thing that has had the most impact in the shortest amount of time is our adoption of Kanban.
We had been noticing that at the start and end of our iterations, we'd be a little slow, either getting started or wrapping up and not wanting to start anything new on a Friday. Kanban completely eliminates that and does a whole lot more. The concept of pulling from the "done" side of the board instead of pushing from the backlog of work has really turned our process around. It takes a different way of thinking from what we're all used to, but everyone has adapted really quickly. Everything seems to be more smooth and natural as we switch between tasks. Maybe it's just excitement or the newness of it all, but throughput seems to have increased as well.
We're still working out a few things - the limit of stories per category, how big to make the stories, things like that. It's all to be expected though. We're taking the advice of everyone at the conference and starting small with a pretty simple board and testing the waters. Everyone seems to love it though, and we all constantly have new ideas. I'd definitely recommend trying this out if everyone on your team is willing to give it a shot.
Here's a link to the KaizenConf wiki page from the open session on Kanban in Smal Teams. Be sure to check it out if you're interested in Kanban.
We had been noticing that at the start and end of our iterations, we'd be a little slow, either getting started or wrapping up and not wanting to start anything new on a Friday. Kanban completely eliminates that and does a whole lot more. The concept of pulling from the "done" side of the board instead of pushing from the backlog of work has really turned our process around. It takes a different way of thinking from what we're all used to, but everyone has adapted really quickly. Everything seems to be more smooth and natural as we switch between tasks. Maybe it's just excitement or the newness of it all, but throughput seems to have increased as well.
We're still working out a few things - the limit of stories per category, how big to make the stories, things like that. It's all to be expected though. We're taking the advice of everyone at the conference and starting small with a pretty simple board and testing the waters. Everyone seems to love it though, and we all constantly have new ideas. I'd definitely recommend trying this out if everyone on your team is willing to give it a shot.
Here's a link to the KaizenConf wiki page from the open session on Kanban in Smal Teams. Be sure to check it out if you're interested in Kanban.
Wednesday, November 12, 2008
SharePoint 2007, MOSS, WSS3.0
Today successfully deployed our applications to test environment and working as expected without any issues.
Migrated about 800K documents from HummingBird system to SharePoint2007.
Developed custom Webservices in SharePoint using SharePoint API and TDD it in VisualStudio2008.
Used CAML queries for searching through managed properties. Awesome fast. Used U2U
CAML builder tool to build CAML queries (they are little complex to write).
Learned SharePoint2007 Administration and configuration.
and lot more.
Migrated about 800K documents from HummingBird system to SharePoint2007.
Developed custom Webservices in SharePoint using SharePoint API and TDD it in VisualStudio2008.
Used CAML queries for searching through managed properties. Awesome fast. Used U2U
CAML builder tool to build CAML queries (they are little complex to write).
Learned SharePoint2007 Administration and configuration.
and lot more.
Subscribe to:
Posts (Atom)