• Internet Explorer 7 hangs indefinitely

    So I saw this awesome issue where IE 7 hangs indefinitely and stops responding on the third request for a page. Yes the 3rd request.

    Basically IE7 is limited to 2 active connections per server inside one browser window (including all tabs) and these connections were being wasted in unresponsive requests for favicon.ico.

     

    Here's what I learned. 

    At the time I did not know that IE browsers attempt to retrieve favicon.ico from ther root of your website every time they make a page request. (How to add a favicon to your website)

    Also, I did not know that this generated a 404 error in the IIS log every single time they tried to retrieve it unsuccessfully.

    Also, I did not know that some web application firewalls (firewalls that constantly learn and update themselves to prevent security breaches) will actually stop responding to requests that are consistently turning up 404 as a safety measure.

    Columnist Ivan Ristic comments on web security "The point is that you are not looking for a single suspicious action any more - you are using counters to look for anomalies. Other examples include looking for IP addresses with too many failed requests (too many 404 responses typically point to web application scanner activity), enforcing session inactivity timeouts, session duration timeouts, and so on."

    Lastly, and the final piece of the puzzle. I did not know that:

    Internet Explorer 7 (IE7) has an extremely long time out for requesting favicon.ico. ("a hex with a lot of F's" said the Microsoft Support Engineer)

     

     

    Full story

    Comments (0)

  • Playing Music and Sound in Managed DirectX

    //Here's the code, pretty straightforward

    //Download this Project in Visual Studio 2008 Format

    //download and install the directx SDK

    using System;

    using System.Windows.Forms;

    using Microsoft.DirectX.AudioVideoPlayback;

    using Microsoft.DirectX.DirectSound;

     

    namespace MusicAndSound

    {

        public partial class Form1 : Form

        {

            private Audio musicAudio;

     

            public Form1()

            {

                InitializeComponent();

            }

     

            private void btnBrowseMusic_Click(object sender, EventArgs e)

            {

                GrabFileNameIntoTextBox(txtMusicFileName,"Music (*.mp3) |*.mp3|All Files (*.*) |*.*");

            }

     

            private void GrabFileNameIntoTextBox(TextBox box, string filter)

            {

                FileDialog dialog = new OpenFileDialog();

                dialog.Filter = filter;

                DialogResult result = dialog.ShowDialog();

                if (result == DialogResult.OK)

                {

                    box.Text = dialog.FileName;

                }

            }

     

            private void btnBrowseSound_Click(object sender, EventArgs e)

            {

                GrabFileNameIntoTextBox(txtSoundFileName,"Sound (*.wav) |*.wav|All Files (*.*) |*.*");

            }

     

            private void btnPlayMusic_Click(object sender, EventArgs e)

            {

                if (MusicIsStopped())

                {

                    PlayMusic(txtMusicFileName.Text);

                }

                else

                {

                    StopMusic();

                }

            }

     

            private void StopMusic()

            {

                musicAudio.Stop();

                musicAudio.Dispose();

                musicAudio = null;

                btnPlayMusic.Text = "Play Music";

            }

     

            private void PlayMusic(string songFile)

            {

                musicAudio = new Audio(songFile, true);

                //loop it

                musicAudio.Ending += ReplayMusic;

                btnPlayMusic.Text = "Stop Music";

            }

     

            private bool MusicIsStopped()

            {

                return btnPlayMusic.Text == "Play Music";

            }

     

            private void ReplayMusic(object sender, EventArgs e)

            {

                //makes it keep looping.

                musicAudio.Stop();

                musicAudio.Play();

            }

     

            private void btnPlaySound_Click(object sender, EventArgs e)

            {

                try

                {

                    PlaySound(txtSoundFileName.Text);

                }

                catch (ArgumentException)

                {

                    MessageBox.Show("Invalid Sound File format. Try a wav file for example");

                }

            }

     

            private void PlaySound(string soundFile)

            {

                var soundDevice = new Device();

                soundDevice.SetCooperativeLevel(this, CooperativeLevel.Normal);

                var buffer = new SecondaryBuffer(soundFile, soundDevice);

                buffer.Play(0, BufferPlayFlags.Default);

            }

        }

    }

     

     

     

     

     

     

     

     

     

     

     

     

     

    Full story

    Comments (0)

  • Building A Culture of Responsibility

    When you can't find your keys in the morning, is your first reaction to yell "Honey, where'd you put my keys?" When you're late for work after not being able to find your keys for 20-30minutes do you give the excuse "Sorry, I couldn't find my keys" or do you lie and say "Man, traffic was such a bear!"

    Inspect yourself and watch your teammates for this type of behavior as it is a sign that they lack responsibility. Responsibility is a pillar of great teams because responsibility builds trust and accountability. When individuals are responsible for their actions no matter the outcome then you can start to trust eachother better and improve.

    The key to this mature responsible thinking is remembering it is OK to make mistakes. No, it is GOOD to make mistakes. Without mistakes, we learn nothing. Unfortunately, some organizations have built so much culture and process around eliminating mistakes that they cease to function on a level that encourages learning or growth!

    There's a type of procrastination that may be familiar to many of us. It's basically procrastination through perfectionism. Effectively, this means that a perfectionist is so afraid of making a mistake that they put off doing anything until the have a proper plan or maybe the put it off completely and never get around to it. "Oh why bother, i wouldn't be able to do it the _right_ way, so why do it at all?"

    Now which feels better, letting people know you made a mistake? or some random guy mentioning your mistake at a meeting in front of everyone when you were trying so hard to cover it up?

    Go out, try hard, and if you make a mistake, let everyone why you made the mistake and how you learned from it and they will learn from it then too. Enjoy your mistakes because you learned something you didn't know before!

    One thing that I try to work into conversations about our daily scrums is that, impediments are not someone's fault. They just are what they are and we need to create a solution! This culture has to start by setting a good example, so don't punish people for making mistakes. Congratulate them! For they just saved you a hard lesson.

     

    Responsibility Process Model

     

     

    Full story

    Comments (0)

  • Tips for Recruiters

    Here's the standard pitch that I hear from recruiters who are 'phoning it in to work'

    "Hey, I have this exciting opportunity and I really want to talk to you about it, please give me a call and I'll go over it."

    Translation.

    "Hey, I stumbled across you while googling and I have no idea if you'll fit anything I have but I want you to call me because that shows you are looking."

    Failure. You're only going to get lame candidates who are seeking for a way out of their current job.

     

    Here's another one that i get since i have "agile coach" on my resume.

    "This company is looking for someone to do agile software development."

    Translation.

    "This company doesn't do agile, but they want to be buzzword compliant so if they hire you they can say they're agile."

    Failure. Agile software is a team thing and must be supported by the business units who want the software.

     

    This one is the absolute worst.

    "Looking for project manager for 6 month project."

    Translation

    "Looking for a scape goat to blame this failing project on because we're 9 months behind and over budget but it just won't die."

    Failure. Don't let the client fool you on this. You want to bring good candidates to good companies, not ruin your reputation.

     

    So here's what I suggest for technical recruiters.

    1. Showing that you're not trying to find the right candidate for the right job by spamming out randomly at people who fit the general buzzwordiness of the job description only makes it readily apparent that you care nothing about the candidate but only the placement.
    2. Learn the lingo beyond just the buzzword. Understand the buzzwords and why people are spouting them off.
    3. Understand your client and why they're hiring the position because good candidates are going to ask and you don't want to look like a moron saying "Huh? Well I don't know why they have this open position. I guess I am wasting your time."

    Bottom line, if you care about your candidates more than you care about your clients then you will build lasting networks that you can re-use. Good candidates placed into good career opportunities become great clients eventually.

    Full story

    Comments (0)

  • Exception Handling in .Net

    There's two topics I want to talk about.

    The Overly broad catch and Wrapping APIs that don't use Exceptions. (Such as some websphere/java services I've been working with lately)

     

    It’s a pandemic in most of the code I look at where I work. Nothing against the developers I work with. We inherited this code and we’ve been copying and pasting our way to glory because “if it works don’t fix it”

     

    I got into this all-time religious war with one of my co workers today because he was catching System.Exception and returning false within a method. I asked why, and he said because he wanted to make sure to return false if anything failed.

     

    This article would have helped me explain better why you shouldn’t catch system.exception

     

    The basic premise is that when you catch System.Exception you’re catching everything that could possibly happen. So when your program doesn’t work the way you expect it should, you have to go deep diving into the debugger to find out what is getting caught in the exception handler (or log every single exception that gets to there in some giant log file that becomes a dumping ground for random BS and garbage)

     

    So the other topic. Wrapping code that doesn't throw exceptions.

    How many times have you seen code like this:

     

    Int returnCode = Foo(out myparam1, out param2);

    If(returncode != 0)

    {

                //do stuff

    }

    Else if(returncode == 3)

    {

                //do other stuff

    }

    Else

    {

                //an error happened, log stuff and exit.

    }

     

    YUCK! J

     

    Ideally you’d want something like this

    Try

    {

                Foo(out myParam1, out myParam2);

                //do stuff

    }

    Catch(Exception3 ex)

    {

       //do other stuff

    }

    //all other errors bubble up to the main program.

     

    So anyhow, how do we get to something like this if we have an API that uses error codes?

     

    Just wrap it and throw exceptions. Preferably custom exceptions that are descriptive (unlike mine that are named genericly for example purposes)! J

     

    Public void foo(out int param1, out int param2)

    {

                Int code = foo(out param1, out param2);

                If(code != 0) return;

                If(code == 3) throw new MyCustomException(“Code was 3”);

                Else throw new MyCustomGeneralException(“A bad thing happened, error code was: “+code.ToString() );

    }

    Public class MyCustomException : System.Exception{}

    Public class MyCustomGeneralException : System.Exception{}

     

    Anyhow, try this out and see if it helps your code read better and flow smoother.

    Full story

    Comments (0)

  • We Care Ministries launches website

    The website we worked on at Coders 4 Charities officially launched. Much thanks to Cody Inman who put most of the effort into the project from custom css and design to getting hosting provided.

    You can view the site http://wecareministries.org

    I think this is cody's site: http://www.codyinman.net/

    Again thanks to http://coders4charities.org/ for running the event and giving us a way to use our talents to give back to the community. I look forward to the next one and encourage people to hunt down more charities to bring them into the fold.

    Full story

    Comments (0)

  • Revitalizing a technical career

    Jeremy Miller at Code Better gives some advice to developers who are trying to sharpen their saw.

    It's also good advice for anyone wanting to start a career in software development.

    Similiarly to Jeremy, I wonder if other managers feel the same way about concepts/fundamentals and getting involved with open source projects.

    Of course blogs aren't credible so everything Jeremy says is BS, right?

    I think you're smart enough to decide on your own.

     

    What about his comment that makes the suggestion to move on if you're in a moderate engineering company?

    Are you the rockstar at your shop? Would you rather move on than continue to improve and stay the rockstar?

    Is it true that you're only as good as your weakest link?

    Full story

    Comments (0)

  • I'm calling you out, C-Money

    This is officially a throw-down to Chris Leon over at http://itjourney.wordpress.com/

    Friend, for too long i've been asking for you to give me your reading list for Java so that I can work that skillset up. You've evaded me at every turn ... but no longer!

    So let's see it man-o. Show us what we have to read to get Java-fied.

    I'm thinking I might by a Kindle 2 or used kindle1 to buy these books that you recommend... should you ever recommend them.

     

    Full story

    Comments (3)

  • Iterative vs Incremental

    Iterative and Incremental development are two different things when it comes to software development. They are, however, not mutually exclusive to one another and thusly why IID is interative and incremental development.

    An iteration is a segment of repetition. If I were to do an iteration in programming I would probably do the same thing over and over until a predefined time has expired or a certain value has been aggregated. In software development, an iteration means repeating steps to develop a set of functionality for the software. Probably analyzing, designing, coding, testing, and then deploying a functional feature.

    To contrast this with incremental I would say that an increment is quite literally "additive" or "something gained". It is building upon something already existing to make it more than it was before.

    Imagine you have a stalagtite hanging from a cave ceiling and below it a meager stalagmite. Each drop of water is an iteration while the residue left on the stalagmite is the increment. Iteration after iteration the water falls to the structure leaving an increment of sediment that hardens and eventually grows taller and wider.

    In software development we might be creating a job posting software online. The ability to post jobs is a fairly large feature. We might consider an increment of posting jobs to be the ability to write a job description and an email address to send resumes to.

    Later on, with another increment we might add the ability to put in a salary range.

    Then job requirements...

    then... well you get the idea.

    Iterative however does not imply that you are adding onto something. You could simply be iterative making something new every single iteration.

    Now why does it matter?

    Well, adaptive or emergent software development is the act of building something then showing it to the customer and soliciting feedback. Then using that feedback to make the product better by improving it. The idea is that you never make the 'right software' the first time out.

    When you write a paper for college, you usually write a quick rough draft. Then you submit it for peer review or these days you send it to some grammar software that reviews it for you. You might proof read it. Over and over you look at it and revise it. This is the adaptive part of you developing your paper.

    Now take it a step further.

    Try doing your paper one paragraph at a time. Write the first paragraph and then refine it. Try to make it better, more concise, and stronger. Read it again and again and change it each time until you think it's the finished product that you plan to turn in. Now write the second paragraph. Does the first paragraph still make sense? Read both paragraphs within the context of eachother. Revise them as a whole. Now create the third paragraph. Have a friend read it, or even have the instructor read it before you turn it in.

     

    Take all of these ideas to software and you will understand the differences between incremental and iterative and how to apply them more enjoyably in your work.

    Full story

    Comments (1)