Technodrone

there's some good in this world, Mr. Frodo... and it's worth fighting for.

  Home  |   Contact  |   Syndication    |   Login
  14 Posts | 2 Stories | 37 Comments | 0 Trackbacks

News

Article Categories

Archives

Post Categories

Image Galleries

Code hacks

Face Book Profile

LinkedIn Profile

Recommended Products

Friday, October 23, 2009 #

Someone that I respect in software development recommended this book to me. Pragramatic Thinking & Learning by Andy Hunt. I got it in the mail last evening and have already read half of it. He talks about the Dreyfus Model Stages. These stages apply to any profession and were first implemented in the early 1980s with nurses.  He says skills in a profession are distributed in 5 levels from lowest to highest: Novice, Advanced Beginner, Competent, Proficient, and Expert. Most people don't get past Advanced Beginner. After reading this chapter I now see why implementation of agile will likely fail if any of the team members are at the Novice or Advanced Beginner stage.  I would recommend to any developer interested in maximizing their skills and mental sharpness read this book.  It is an enjoyable book to read as well.

Saturday, October 03, 2009 #

I am currently working with a company that has a 40 million dollar contract that will be lost if the code is buggy and incomplete. We have just started writing unit tests. TDD is foreign to most of the team members. Most of the code is contained in the code behind of aspx pages. I am using selenium to write the unit test. Team members are getting frustrated because of the tight deadline; they feel they don't have the time to unit test. While this is going on the company has decided the team should use the agile methodology yet they have no training/mentoring so it is causing them more frustration and anxiety. We have a consultant telling them they must learn TDD and agile while at the same time they have an extremely tight deadline. The deadline will not budge. I want the team to be able to produce quality code within the timeline. At the point it is too late to eliminate the spaghetti code and lack of domain objects. I still want as much test coverage as possible. I am the go between the developers, an agile consultant and the management. Any ideas?

Tuesday, July 28, 2009 #

My bank/credit card company is jerking me around. I mail my bill in on the 1st it is due on the 12th but magically it always gets posted to my account on the 13th making it late.  This has me extremely p*ssed off. To make a long story short, I think they are purposely posting the payment the day after the bill is due. I would like to meet the programmer(s) who agreed with this as a user story see want kind of jerk thinks this is ok to do to their customers.

You would think they would use a random function to make my payment post on a day other than the oh so predictable 13th.  This way their customers don't pick up on the pattern. Mine ALWAYS posts on the thirteenth no matter how early I send it in.  A good random function could make it sometimes post the 10th just to make me think the mail was running fast that month . It could have a range of 5 days. How about from the 10th - the 15th. Then most of the time the bank can get that $39.00 late fee and jack up my interest.

If you are dealing with a bank that treats you like dirt , file a complaint on them. The bank has to reply to your complaint in writing within 30 days. They won't admit fault but at least they had to spend some money dealing with your complaint. If enough people do it it may not be worth the money they are getting by jerking you around.  By the way the bank I am dealing with got a big bail out.  I guess when your bank is ran like amtrack this is what you get. Programmers that are too stupid to effectively rip their customers off.  Run of the mill thugs I tell ya.

File your compliant here:

http://www.helpwithmybank.gov/

 

 


Wednesday, January 28, 2009 #

I enjoyed this article this morning. I observe and play the chicken game constantly. I always called it the "Is it done yet game".  As the recession worsens we are afraid to say "that enhancement to the web site will say 2 weeks to code and a two weeks to test/fix".  Instead we are told do it all in 40 hours knowing there is no stinkin way that is gonna happen.  If you tell the project manager is going to take longer because of testing and integration you are told. "That is not part of the time estimate.'   If your team uses agile sometimes this game is played on a daily basis at the morning stand up meeting.  One of the most popular strategies is to say we are 95% done.  I will admit I have sometimes fibbed and said I was making progress when instead I was behind schedule.  It buys a little time but only works a time or two. In these cases everyone is playing chicken with everyone else just because the team is unwilling or afraid to be honest about time estimates. I think this kind of behavior worsens as we try to do more with less.  In the long run the project still takes as long as it takes. If people are truly striving to do a good job. The  developer may have originally estimated 40 hours the project manager said no do it in 12 hours. In the long run it still takes 40 hours or possibly more due to lack of communication. Why can't we just communicate more honestly . That is just not in vogue in today's climate of fear of retribution.  We just keep playing this time wasting non-productive game.  Here is a link to the article on Stickyminds.com.

Managing the Chicken Game

Disclaimer: References to the Chicken Game do not reflect upon current or past employers. It is just a half thought out editorial based on lack of sleep. No animals were harmed and I only consumed 2 carbon credits creating this post. I put my redbull can in the recycle bin by the way.

 


Friday, January 02, 2009 #

I came into the office on January 2, 2009 and found out one of my applications was not finding files that have names based on the day of year and month of year.  Here is the problem, my code was looking for a file called  'thepreciousfile200911.txt" instead of "thepreciousfile200901001.  This worked 12/28/2008 but when the day of year changed to a single digit on the new year I could no longer check for file existence because the string I was using for the file name was now wrong. When I retrieved the day of year from the current month I blanked out and did not think it would return as 1 and if it did that was the correct file name anyway. Well it was wrong.  Here is what I did to fix it and it was extremely easy.

 

In this example the 3 is the number of characters I want the resulting string to have and the '0' is the character you want to use for padding if the day of year does not equal 3 characters. 

string dayofyear = Convert.ToString(DateTime.Now.DayOfYear).PadLeft(3, 0);

Friday, December 19, 2008 #

The following code adds an attachment to an email if the attachment file exists. If the file does not exist the the email informs the recipient that the file was not found. The recipients are read in from a text file. This sample sets the priority of the email to high and sets the body of the email to html so you can do some formatting. You will need a "Using" statement for System.IO and System.Configuration since things like email server and path to the list of recipients are stored in a config file.  This particular example is from a console application. "EmailBody" is a string builder that as added to as various processes are checked. Note of caution: be the email can be sent from "valid" looking email address and be beware of getting your "Send" portion of the code in a loop.  I know how embarrasing that can be. Have fun, be careful.

        protected static void EmailNotification(string FileName)

         {

            //name of email server

            string emailserver = ConfigurationSettings.AppSettings["emailserver"];

            //path to file that will be added as an attachment if it exists.

        string gl_daily_transactions = ConfigurationSettings.AppSettings ["gl_daily_transactions"];

        var devemail = new System.Net.Mail.MailMessage();

        var mailClient = new System.Net.Mail.SmtpClient(emailserver);

        devemail.From = new System.Net.Mail.MailAddress("XYZInterfaceMonitor@notarealcompany.com");

        string subjectline;

        if (Success)

        {

            subjectline = "XYZ Interface process completed successfully. ";

        }

        else

        {

            subjectline = "XYZ Interface process did not complete successfully. ";

        }

     

            devemail.Subject = subjectline;

    

        devemail.Priority = System.Net.Mail.MailPriority.High;

        if (File.Exists(gl_daily_transactions))

        {

            System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(gl_daily_transactions);

            devemail.Attachments.Add(attachment);

        }

        else

        {

            //append to string builder object

            emailBody.Append("<hr />The GL Daily Transaction File was not found.");

        }

 

        devemail.IsBodyHtml = true;

        emailBody.Append("<hr/>End of Notification");

        devemail.Body = emailBody.ToString();

      //FileReader returns an array of recipients from a text file

        string[] recipients = FileReader.ReadFile(FileName);

 

        for (int index = 0; index < recipients.Length; index++)

        {

 

            if (recipients.Length > 0)

            {

                devemail.To.Add(recipients[index].Trim());

            }

        }

        mailClient.Send(devemail);

 

    }

 

       

 


Friday, December 12, 2008 #

I have been hacking at this for two days. I could use a little help here. I am rewriting a console application that uses a com object named transaut.tlb.  This object exposes cognos transformer functionality. I used tlbimp.exe and imported it.  When I make reference to this dll and use it in my code, the code compiles but I get the runtime error "CLSID{blah ,blah...} failed due to the following error: 80040154".  I tried making a reference to the orginal com object transaut.tlb I tried registering the imported dll but got the error  "cognostransformer.dll was loaded but the DLL Register Server entry point was not found. This object worked with .net version 1. Any help would be appreciated.   Thanks

Thursday, September 18, 2008 #

I have a copy of the "Principles behind the Agile Manifest stapled to my cube wall (http://www.agilemanifesto.org/principles.html).  One of my favorite principles is :

"Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely." 

To me this principle promotes work life balance and leads to less burn out and developer attrition.  As our economy weakens I find myself working weekends and into the wee hours. Is this sustainable development?  I am tired and energy drinks are no longer working. I see this happening not just in software development but in  all types of employment.  I find that if I stay up until 3a.m.  to work on a problem I have a hard time waking up at 5:00 am to start a new day. For those involved in Agile development the whole process starts to fall apart when people are not honest during the estimating phase of the project because they are afraid to say they think something will take 40 hours not the 10 hours management would like to see.  We, including myself are shooting ourselves in the foot when our work load becomes unsustainable.  Problem is I don't know what to do about it.  The country is practically in a depression and our employers are also fighting an upstream battle to stay afloat economically.


Wednesday, August 13, 2008 #

The built in validator controls can remove the tedious code needed to traditionally check user input and I have found that using them in very simple pages is a great time saver but using them on a complex page  where valid input varies depending on any number of factors it is better to verify input programmatically, tell the user if there were any problems, tell them what to do, tell them if there were any database errors , or if they successfully completed their transaction.   Whenever I create UI pages or classes I always pre-plan for  what I call "user messages".   I even program these into interfaces so they are required in any implementing classes.  Example if a "Save" is successful in an object pass a boolean of true if not successful  I will tell the user and also write it an error log.  I have read that validation controls keep you from having to do things like regex functions to see if a string contains a Phone#.  I can write the function to check this and put it in a class and call it when needed rather than having to put the control on each page needing Phone#.   I work in an environment where validation can change monthly or even during a part of the month (close of month) so I don't use the validation controls unless I think the requirements for input are not likely to change. 
I have found it most flexible to create a stringbuilder object and append user/error messages to it.  I can then display the messages in a variety of ways depending on a variety of conditions.  I find this is easier to change if the user decides that a phone# is only required for citizens of Arkansas but not for Missouri and then only in certain area codes.
My co-workers don't agree with me. They strive to make the built-in validators work at all cost, and want me to conform.  I am just not feelin it.


Tuesday, August 05, 2008 #

Business owners wanted a report with a hard coded date range rather than a date range prompt. Customer is always right, especially in an economic downturn.   I could not figure out how to do this and after a couple of days of trial and error I got this to work.  I hope this saves someone some time.

--get past 30 days
[Business View].[Sales Tracking Transaction].[Sale Date]between _add_days(current_date,-30) and current_date

--get past year
[Business View].[Sales Tracking Transaction].[Sale Date]between _add_Years(current_date,-1) and current_date