Brief technical tip, slow running JavaScript

I have been researching a problem where a very complex piece of JavaScript code is occasionally causing the very annoying warning which states “A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?”".  While developers have patience for this problem, customers do not, and should not, have to deal with this.

Since the error is only impacting one user within one customer installation I am pushing off a complete rewrite of the JavaScript until our next release.  However, this Microsoft knowledge-base article provides instructions for working around the problem on a machine by machine basis.  Here is the summary for how you change this behavior for IE 4.0 and above:

  • Using a Registry Editor such as Regedt32.exe, open this key:
    HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Styles
  • Note If the Styles key is not present, create a new key that is called Styles.
    Create a new DWORD value called “MaxScriptStatements” under this key and set the value to the desired number of script statements.

I ended up adding the key with a value of 500000000 (5 Million) and the customer is now happy.

John

2009 #topclient. What is the best desktop/web client for Twitter?

I have been on Twitter for a little while now and I have been religiously using Tweetdeck for the majority of my Tweets.  It’s time, however, to answer the question that has been on my mind, and probably on yours as well….  What is the best client for Twitter?

Your vote will provide the answer to this question for everyone and ultimately decide which client I end up using.  Please pass this along throughout the Twitterverse and use the power of the community to answer this question.  Note:  If you don’t see the client you want to vote for, leave a comment and I’ll add it to the poll.

Drumroll please….  The Winner is…

Tweetie is the clear winner for the 2009 #topclient with 36% of the vote.  Congratulations Tweetie!

The Twitterverse-wide vote resulted in more than 700 votes being placed to choose the Best Desktop/Web client for Twitter.  Tweetie’s strong, passionate, following carried the day.  Congratulations to Tweetie, the Twitterverse choice.  Here are the top 5 clients according to the vote:

- Tweetie with 36% of the vote.
- PeopleBrowsr with 16% of the vote.
- TweetDeck with 13% of the vote.
- Bluebird with 8% of the vote.
- Twangle with 4% of the vote.

Feel free to check out the press release and share with  your friends, you helped choose the winner.

Stay tuned for the 2009 #topmobileclient voting which will begin May 25th and run through until 8 PM ET on June 12th.

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

With ActionScript simple things remain simple

At Swimfish, as with any small/start-up company, I have the pleasure of working with people that are decathletes.  Everyone is capable of tackling tasks in a variety of areas which makes every day a true pleasure.

One of our talented support engineers has been helping out by working on a replacement for our small product ad that we show on our login page.  Essentially, we need to rotate between three product ads, with each of them looking something like:

Key points are:

  • Every time the page loads we need to open a random ad.
  • The arrows handle forward and back behavior.
  • The numbers (below the phone) can be selected to move to the correct ad.
  • The “Schedule a Demo” buttons open up a scheduling application that our sales team uses.

Here is how this simple Flash file was put together:

  • Using Adobe Flash CS4 Professional my teammate put the images and text in place.
  • To support starting on a random frame, we used two simple lines of ActionScript:

var startFrame:int = ((Math.random() * 100) % 3) + 1;

gotoAndPlay (startFrame);

          Using the modulo function to get the remainder of a number (plus 1) we’re able to generate a random number that ranges from 1 to 3.  We then use gotoAndPlay to start with that frame number.

  • The ActionScript to handle the button clicks is very simple as well, looking something like:

btn3.addEventListener(MouseEvent.CLICK,go30);

function go30(e:MouseEvent):void{
 gotoAndPlay(3);}

     We simply apply an event listener to each button that is setup to navigate to the correct frame in the movie.

  • The code that is used by the “Schedule a demo” buttons is only slightly more complicated:

anywherebtn.addEventListener(MouseEvent.CLICK,goAnywhere);
function goAnywhere(e:MouseEvent)
{var request:URLRequest = new URLRequest(“http://my.timedriver.com/GYXDM“);
navigateToURL(request);}

     Once again the button click is managed by the event listener.  The only difference is that we open a web page when the button is clicked, going to TimeDriver.com.

Let me know if you have any questions or comments.

John

April’s Top 5 posts

How to interview, and hire, great developers

In order to answer this question you must first define what a great developer is.  I won’t rehash my earlier post on the topic, you can read my thoughts in this older post if you are interested.  Answer the question for yourself, then:

  • Identify the superstars you have worked with in the past.  Keep in touch with them; these are the people you want to work with again in the future. 
  • Begin reaching out to others in your network, especially other managers who can identify the superstars they have worked with in the past.
    • Do not limit your definition of your network to just the people you have had the pleasure to work with.  Use groups on LinkedIn, leverage friends on Facebook and Twitter, and attend conferences and seminars, spreading the word as you go.
  • Find the right recruiters.  If you don’t know how to do this, read here.
  • Organize your interview team.  There is no “right” formula.  However, I believe in:
    • Having candidates come in for two rounds of interviews.
    • Each interview round should last 2.5 – 4 hours.
    • In the first round I ensure that senior developers, a senior qa engineer, a project manager, and I meet with the candidate.
    • As part of the first round, candidates must complete a developer test that you have built.  This test should enable you to understand their comfort level with the languages, tools, and platforms that you utilize.  For ideas, check out this post I found on Techlure which lists some very good questions.
    • In the second round I will have the candidate meet with more developers, another qa engineer, and a documentation writer (if appropriate for the job).
  • I focus my portion of the interview partially on technical skills and partially on understanding what makes them tick.  While I won’t go into details on my interview questions (I may interview you one day), here are the types of questions I ask and why:
    • Why did you become a developer?
    • What do you love about being a developer?
    • What do you dislike about being a developer?
    • If you had not become a developer, what would you be doing?
    • What is your favorite language?
    • Have you worked with QA in past jobs?  What did you like, or dislike, about the experience?
    • What was the coolest coding problem you’ve worked on?
    • In the last two weeks, what was the hardest problem you had to solve?

While there are more questions, these types of questions tell me a lot about the candidate.  The answers that are provided, as well as the manner in which they answer the questions, tell me more than they realize.  I might have become a psychologist if I had not become a developer. :-)  

Finally, as you know, I like Twitter.  If you are on Twitter, follow these people as they regularly provide good career related information:

One other quick update from a thorough post I read today. Please review this post when you have time.
John

Remembering there is life outside of work

Sorry for the off-topic post.

We all have been impacted by personal and/or family misfortune.  For me, I watched my mother in-law, and grandmother in-law, suffer through the ravages of Alzheimer’s disease. The suffering was difficult to watch and the hopeless nature of the situation is hard to ever forget. 

In 2001 my family and I formed Team Josephine.  This fund raising team was named in memory of four women named Josephine in our family that all suffered with this disease.  If you have been personally impacted by this disease, or even if you just want to donate money to help fight the spread of this disease, please feel free to join us by donating here.  Feel free to pass this along.

I promise, the next post will be back on-topic.

John

Surviving a layoff when you’re not one of the people laid off

There is no doubt that the people who are laid off are impacted more than those left behind.  However, it can be extremely hard to stay focused and energized if you are still coming to work while your friends and old co-workers no longer are.  More than ever, step back, and:

  • Admit that you’ll miss the people that are no longer there.  While layoffs are driven by business needs we are all human.  Acknowledge the negative feelings but don’t linger on them.
  • Work with your managers to ensure that nothing falls through the cracks.  The people that are no longer on the team had real work to do.  If you are capable step up and help out.  It will make you more valuable, show you’re a team player, and most of all, keep your company on track, meeting the key goals.
  • Stay focused on achieving your goals.  Your company may be struggling financially but things will only get worse if you, and your teammates, are not able to stay on track.
  • Stay positive and be a cheerleader.  No, I’m not suggesting that you run around spouting motivational quotes.  However, make sure everyone understands the big picture, you must find a way to work through this challenge.  If you can, you’ll give each of you, and your company, a chance to stay in business.

What other recommendations do folks have?

John

A challenge of sorts, formatting phone numbers

As I noted elsewhere I have been focused on releasing a new version of our Milestone Tracking Matrix product, one of Swimfish’s leading applications.  One of the defects that I began looking into was related to how poorly we were formatting phone numbers within the application. 

Simply put, are requirements are that we need to show US-based numbers phone #s formatted as “(###) ###-#### x####”.    In other words, area code in parenthesis, the remaining 7 digits separated by a dash, and the extension formatted as “x” followed by the extension.  Fairly simple. 

Here was the function that we had in place (emphasis on HAD IN PLACE):

public static string formatPhoneAndExtension(string phoneIn, string ext)  {

    string phone = phoneIn.Trim();

   string formattedPhone = phone; 

    long tempPhone;

    if (phone.Length == 10 &&  long.TryParse(phone, out tempPhone))   {

                 formattedPhone = string.Format(“{0:(###) ###-####}”, tempPhone); 

     }

     if (!string.IsNullOrEmpty(ext))             {                 formattedPhone += ” x” + ext;             }

    return formattedPhone;         }

Phone numbers are entered in a text box with only minimal JavaScript formatting and have to work for a variety of numbers like:

  • 978.223.1468
  • 978-223-1468
  • 9782231468

While I have refactored and come away with something vastly improved I’d love to hear how others would have approached this function.  Anyone care to respond with better alternatives to what you see above?  The good news, you will only be making improvements.

John

Why is it that the best bugs are found at the end of a release?

It never fails.  I have worked with QA groups ranging from 1 to 100 and you always end up finding the most interesting, and sometimes the most critical, issues right at the end of a product release.   There are a number of reasons for this phenomenon, here are the ones I have seen most often:

  • QA does not receive working features until the end of the release.  Release dates are fixed and everything comes together at the last minute.  We have all seen this and it always results in two things:  A mad scramble by all involved; A patch soon after the initial release.
  • QA is properly staffed and works on “proper procedures”, developing robust test plans for each feature.
    • This is great, but sometimes leads to the basic aspects of features being tested with limited to no real world testing taking place.
    • Your QA team should be building test scenarios from the original business requirements and testing these as soon as they can.  If the customer can actually accomplish the the business tasks you were trying to automate they will be more forgiving of typos in a dialog.  However, they will not care that the product is free of typos if the core requirements have not been met.
    • You must build in time for random or freeform testing throughout the cycle.  Let your team be creative.
  • Lack of customer testing.   QA teams do great but they are not your final customers.  Supplement developer and QA testing with customer beta testing early in the process.
  • Unfortunately, many times, you also fail to test for performance, scalability, and security issues until near the end.  Ensure this is done throughout the cycle or you will have even larger issues to deal with late, when you least want to make these detailed changes.

John

Sunday coding is productive coding

Okay, truth be told I would have much prefered spending time with my wife and kids, but there are days where work comes first, today was one of those days.    At the end of the day though I’m happy to say we are looking good to posting a new version of the Swimfish Milestone Tracking Matrix tomorrow night around 10 PM ET.

While I’m mentally drained I did want to mention a couple of topics that are worthy of discussion, would love to hear your thoughts (either as comments or tweets), when you have time.

  • What is the best way of generating a web-based installer for your web applications?  While I generate web deployment projects I have to believe there is a better way.  Has anyone had success with other methods?
  • Why is it that the best software defects are found in the last 48 hours of a product release? 
  • At the end of the release what processes do you follow to deploy new builds to your QA team?  We are constantly deploying new builds as fixes are rolled out.  What’s your approach?

I’ll fully explore these topics in upcoming weeks, looking forward to hearing your thoughts in the meantime.

John

Follow

Get every new post delivered to your Inbox.

Join 26 other followers