Saturday, February 12, 2011

How to keep business support team motivated?

In the course of my career I've noticed that developers working on new functionality are, as a rule, more cheerful than these assigned to troubleshooting and fixing bugs.

Good tips on keeping business support a happy? Organising business support in the way that team's morale isn’t hurt?

  • I have seen this too. There are few approaches that I can think of:

    1. Give some thought to selection process.

    Not everyone have same career aspirations. While some people are always dying to work for the latest technology and challenging projects, there are others who are content at a stable work environment. Picking the person with right KSA (Knowledge, Skills, Attitude) is always central to good person-job match. In this case, you just need to put more stress on the Attitude part.

    2. Choose the right lead

    Team leads play crucial role in controlling the motivation and morale of the team. There must be an open and frank channel of communication with team lead and upper management. Ideally a person from the senior management should be made the owner of the team in formal organization chart. Team lead should actively try to foster a team-culture that suites the nature of the team.

    3. Rewards

    Rewards off course are key tool for managing motivational issues. Just make sure the person receiving the rewards understand that the nature of job was also taken into consideration in decision to reward. If this point is not addressed, it is likely that the person will not take this factor into account when perceiving internal equity.

  • If we start with the assumption that the reason for new function developers being happier is that they get to feel proactive or in control and the troubleshooters are reactive and pushed around by the users one answer comes to mind:

    Create a model for those doing troubleshooting to fixes to generalise these from point fixes into broad, consistent fixes for a class of problem. This puts them in the situation of creating new code, even if not new functionality, and they get to think a problem through and anticipate and avoid problems rather than playing whack-a-mole.

    In fast moving environments it may also be possible to rotate people through the job descriptions by have them follow their feature from new development into fix and realease and hopefully into version 2 of the feature.

    que que : This answer is incredibly well thought out and so well put! I wish I could give this 10 up votes.
    MarkJ : Let them refactor.
    From Bell
  • Our organisation has a substantial amount of support work and we've got hit with this problem really hard. The motivation on support teams could dropping down exponentially over the time if you don't do it right.

    The principles which worked for us were:

    1. Choose the right people. Some people are happier doing new stuff. Some people are actually much more suited to a steady no-nonsense job. It means that you should have two teams - one for development and one for support. Developers only stay on a completed project until they pass their knowledge to the supporters.
    2. Choose the right leader. Good organisation is make or break here. A good leader would help to organise good relationship with the product users and at the same time will care for his team.
    3. Rotate. We try to keep the support people on the project for a period of less then 2 years and then move them to something new. This helps maintaining proper morale and ensure that their skills don't rust.
    4. Relationship with the customer. Make sure that the support team know how valuable they are. The customers/users should occasionally visit the team or the team should go on-site to have a face-to-face session with the users (a friendly dinner or lunch will also help)
    Totophil : Ilya, whilst I strongly agree with many of your answers I am not sure that splitting developers into development and support groups is the best approach. Then you get a tendency for project teams to push things, hoping that they will get fixed as support by a different group. To be cont.
    Totophil : Secondly, dedicated support team often would fail into the trap of looking for quick fixes and not having the influence on the big picture. Their motivation is usually to keep their job (more issues), faster response times (i.e. curing symptoms, not root cause), higher throughput
    Totophil : that can be achieved throught solving repetitive issues they already know to fix. Thirdly, dividing development and support functions you pretty much shield the developers from actual feedback and pain of the real-world software needs.
  • Following Bell's suggestion, consider letting new or junior developers cut their teeth on fixes. Promote them from maintenance to the feature team based on their performance and ability.

    Healthy competition is also a good motivator, but it must be managed to remain a positive influence.

    From Adam Liss

C#/.NET: Detect whether program is being run as a service or a console application.

I have a C#/.NET program that can run both as a console application and as a service. Currently I give it a command-line option to start as a console application, but I would like to avoid that.

Is it possible to programmatically detect whether my program is being started as a service?

If it was pure Win32, I could try starting as a service with StartServiceCtrlDispatcher and fall back to console if it returned ERROR_FAILED_SERVICE_CONTROLLER_CONNECT, but System.ServiceProcess.ServiceBase.Run() pops up an errordialog if it fails and then just returns without signaling an error to the program.

Any ideas?

  • I haven't tried it, but it's possible that Process.GetCurrentProcess will help - under console mode the process name would be the same as the executable, whereas I'd expect (and again, please check!) that when running as a service it would be different.

    Marc Gravell : I thought that the process was still (usually) the same exe itself, unless you go out of your way to rehost via svchost.exe or similar...
    Jon Skeet : Could be - hard to test from my current desk :(
    Arne Claassen : At least under mono, the process name does change to the executing entity (i.e. if run with mono-service the process is now called mono-service). Haven't tried as a windows service
    From Jon Skeet
  • Rasmus, this is the earlier question.

    From the answers it seems the most popular way is to use a simple command line option, or try accessing the Console object in a try catch block (in a Service the Console is not attached to the process and trying to access it throws an exception).

    Or if you're having trouble testing/debugging the service, move code into a separate dll assembly and create a seprate test harness (winforms/console etc).

    (Just noticed that Jonathan has added his solution to the end of the question.)

    From Ash
  • Environment.UserInteractive will do the magic.

    taspeotis : What if the service is running on Windows XP with "Allow this service to interact with the desktop" set?
    Ishmaeel : It will stop doing magic, that's what :)
  • I don't know if this will work, but you may want to try using PInvoke with this code and checking if the parent is "services.exe".

    From taspeotis

nHibernate, can I map to a table that doesn't have an row-per-object mapping?

I have a database that contains a table that looks a bit like this:

PropertyId, EntityId, Value

PropertyId and EntityId are a combined primary key. Every Entity is spread over a couple of rows where every row contains a single property of the entity. I have no control over this database so I'll have to work with it.

Is it possible to use NHibernate to map entities from this table to single objects? I only have to read from this table, this might make things a bit easier. Or would I be better off just using DataReaders and do the mapping myself?

  • Hi,

    Not quite done that, but you could use a custom SQL query to define your entities (distinct entityid, plus any entity level attributes), see here .

    Although I can see you might want the property/values mapped to attributes of the entity object. Which might mean further queries to populate them by hand - which may mean your data reader route is best.

    If your happy for them to be a collection of the entity then that should be no problem.

    Mendelt : Thanks. I'll try it out. I can store the properties in a list and make them available to the outside world through individual property getters that look up the right property in the list. Not ideal but workable :-)
  • I can't remember the exact syntax, but a map would do it:

    <map name='Values' table='EntityPropertyValue'>
      <key column='EntityId'  />
      <index-many-to-many class='Person' column='PersonId' />
      <element column='Value' type='object' />
    </map>
    
    From David Kemp

Can you recommend a Shockwave Flash (SWF) to "movie" converter for OS X?

I've Googled this in various ways, and there's no shortage of software to do it. Since this is something I'm unlikely ever to do again, I'd prefer a free solution, but I'm also willing to pay if the best solution requires it.

I'm a fairly skilled software developer in multiple languages, so if anyone knows of a library that will do it (and is available for OS X), I have no problem "rolling my own".

I have a large number of SWF files for a training course I'm taking, and I want to convert them to H.264 for use on my Apple TV so I can watch them on my television more easily. This must be Mac OS X software, compatible with an Intel Leopard machine.

I don't mind having to convert to an intermediate format, but it sure would be nice to go directly to H.264.

Thanks in advance for your help!

  • You should have a look at ffmpegx which I am use fairly often and which works perfect for my needs.

    But it looks like it cant convert .swf - but to be sure you should try it. It's free software.

    greets

    From
  • As Flash is an interactive, code driven format (i.e. not linear like a video) you cannot normally just convert to a video format. Even if your swf is a linear animation, there may still be ActionScript code controlling the animation.

    What this means for you is that you just need to make a good video/audio capture of the swf, for which you can use a whichever free screen capture software you choose (you'll probably need a fast computer).

    From Iain
  • I don't know such a swf converter for mac os. But I use iwisoft swf converter to convert .swf to .mov video. good one.

  • FlashVideo Converter.

    From mcandre
  • Handbrake takes FLV files as source and can convert to h264. It is free, relies on VLC (which is again available in 64 bit on Mac so you can use Handbrake 64) and can manage a processing queue.

  • If you go the screen capture route, iShowU HD on Mac is the absolute king and will easily grab just the pixels you want.

    Be careful of the TV exclusion zone if you're watching computer video off DVD for example. You'll lose 10% of the picture round the edge.

    From radbourn3

Getting The Full Result from "ps"

Hi,

How do I get the full width result for the *nix command "ps"?
I know we can specify something like "--cols 1000" but is there anyway I can the columns and just print out everything?

  • Try ps -w -w aux. The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux.

    Chris Jester-Young : There's nothing magical about "aux"; they're simply the 'a', 'u', and 'x' options specified together. So, you can merge the two 'w' options in too. :-)
    unwind : Ah, yes, true of course. I guess it's just my standard incantation, to treat "aux" as an argument more than an option. Thanks, though.
    From unwind
  • Specify the w option twice, if you're using BSD-style ps. e.g., ps auwwx. A different set of options apply when using System V ps.

    Max Howell : This is a comment, not an answer, surely.
    Chris Jester-Young : It's an answer now!
  • There are two different option syntaxes for ps; the standard POSIX one based on SysV, and the BSD one. GNU ps, as used on linux, supports both, which it can do because the POSIX options have dashes in front and the BSD ones don't, as well as some of it's own options in the normal GNU --long-option-name style.

    Anyway, to get all processes in POSIX style is -e, in BSD it's ax (a includes other user's processes, x includes processes without a controlling terminal i.e. daemons).

    There is no single option that will make it include all the columns. There are a huge number of possible columns. The POSIX options -f, -F and -L all cause it to show different sets of extra columns, as does the BSD option u (hence the "ps aux" mentioned in another answer is a very common command).

    If you really want more columns than that you have to name explicitly which ones you want, using the -o (or o) option. See the man page for a list. There's about a hundred different names you can use, but some of them are duplicates, and others display the same info in different ways.

    ephemient : Accurate but answering the wrong question...
    Mark Baker : I read the bit about "printing out everything" to mean they wanted all the possible columns in the output, so I answered that. I agree the bit about getting all processes was the wrong question.
    From Mark Baker

Changing the BG Color of a selected link.

I have a menu that I am using and it will change the background color when I hover using a:hover but I want to know how to change the class= line so that it sticks.

So from the home if they click contacts the home pages

from (a href="#" class="clr") to (a href="#")

and Contacts would change

from (a href="#") to (a href="#" class="clr")

any help?

JD

  • The way to change class (I assume you're talking of the DOM), in javascript is:

    document.getElementById("element").className='myClass';
    

    Hope this helps.

    From friol
  • I believe you are wanting to highlight the navigational item that you're on. My answer here is fairly valid in this question as well, I believe:

    It's a better semantic match and likely an easier variable to set to keep the navigation using the same classes or ids everywhere and only alter the body element's id to match:

    <li id="homeNav">home</li>
    <li id="blogNav">blog</li>
    

    and then on each page...

    <body id="home">
    <body id="blog">
    

    And in the css:

    #home #homeNav {background-image:url(homeNav-on.jpg);}
    #blog #blogNav {background-image:url(blogNav-on.jpg);}
    
    From davebug
  • This may not apply to you, but it may lead you down the right path. If you are using PHP, stick this in your head before the doctype declaration or the (x)html tag:

    <?php
      // Get current page file name
      $url = Explode('/', $_SERVER["PHP_SELF"]);
      $page = $parts[count($url) - 1];
    ?>
    

    Then, in your menu item where you would like the class designation, place the following, but change "index.php" to the name of the page:

    <?php if ($page == "index.php") echo ' class="current"' ?>
    

    So ultimately your menu should look similar to this:

    <div id="navigation">
      <ul>
        <li><a href="index.php"<?php if ($page == "index.php") echo ' class="current"' ?>>Home</a></li>
        <li><a href="page1.php"<?php if ($page == "page1.php") echo ' class="current"' ?>>Resume</a></li>
        <li><a href="page2.php"<?php if ($page == "page2.php") echo ' class="current"' ?>>Photography</a></li>
      </ul>
    </div>
    

    Last step is adding the CSS:

    #navigation ul li a.current {
      background-color: #FFF;
    }
    

    Hope this helps.

    From PHLAK
  • Hi John,

    The mechanism we use frequently is by having a few generic event listeners on the body and have all required events bubble up. Once caught, we check for a certain className (or className pattern) on the triggering element. If such a className is found, we consider it a state identifier, and we trigger behavior based on such states.

    For instance, we have defined className pairs (such as "selected" and "unselected") with the default behavior of toggling. Or make them exclusive by giving the parent element the className "exclusive-selected".

    A simple mechanism like that can be extended to your liking and can be very powerful.

    Allow me to post a simple demonstration. Non-generic, but it is just to illustrate the inner workings of such a mechanism. For this example I consider the className pair "selected" and "unselected" to be exclusive.

    <html>
      <head>
        <script>
          document.onclick = function(evt) {
            var el = window.event? event.srcElement : evt.target;
            if (el && el.className == "unselected") {
              el.className = "selected";
              var siblings = el.parentNode.childNodes;
              for (var i = 0, l = siblings.length; i < l; i++) {
                var sib = siblings[i];
                if (sib != el && sib.className == "selected")
                  sib.className = "unselected";
              }
            }
          }
        </script>
        <style>
          .selected { background: #f00; }
        </style>
      </head>
      <body>
        <a href="#" class="selected">One</a> 
        <a href="#" class="unselected">Two</a> 
        <a href="#" class="unselected">Three</a>
      </body>
    </html>
    

    It ought to work on IE, Firefox and other browsers. Of course this mechanism can be made generic and have all kinds of className states and behaviors implemented.

  • You may want to check out jQuery (jquery.com).

    Using jQuery, you would change the class (and stick it) like this:

    $('#link-id').addClass('your-class');
    

    You could bind the code to the links like this:

    $('#link-id').mouseover(
       function(){
          $(this).addClass('your-class');
       }
    );
    

    http://docs.jquery.com/Attributes

    From Eli

Hooking up GUI interface with asynchronous (s)ftp operation

Trying to implement a progress dialog window for file uploads that look like a cross between IE download dialog and Firefox download dialog with a python GUI library on Windows.

  1. What asynchronous (S)FTP libraries are there for python? Ideally I should be able to do file upload resumes and track the progress of each parallel file uploads.
  2. If I'm running each file upload in a separate process each, how would I get the upload status and display it in a progress bar dialog?
  • "ftplib" is the standard ftp library built in to Python. In Python 2.6, it had a callback parameter added to the method used for uploading.

    That callback is a function you provide to the library; it is called once for every block that is completed.

    Your function can send a message to the GUI (perhaps on a different thread/process, using standard inter-thread or inter-process communications) to tell it to update its progress bar.

    Reference

    TheObserver : Let's say I can't use a python version greater than 2.5, what are my options then for passing a callback parameter?
    Oddthinking : Not so good. IIRC, the callback for *download* was added in 2.5.2 (perhaps earlier?) but wasn't added to the *upload* until 2.6. (See also separate answer for ckftp2.)
  • If you want a complete example of how to use threads and events to update your GUI with long running tasks using WxPython have a look at this page. This tutorial is quite useful and helped me perform a similar program than yours.

    From Mapad
  • If you data transfer runs in a separate thread from the GUI, you can use wx.CallAfter() whenever you have to update you progress bar from the data transfer thread.

    First, using CallAfter() is mandatory as wxPython function cannot be called from child threads.

    Second, this will decouple the execution of the data transfer from the GUI in the main thread.

    Note that CallAfter() only works for threads, not for separate processes. In that case, using the multiprocessing package should help.

    From Ber
  • If you can't use Python 2.6's ftplib, there is a company offering a commercial solution.

    Chilkat's CKFTP2 costs several hundreds of dollars, but promises to work with Python 2.5, and offers a function call get_AsyncBytesSent() which returns the information you need. (I didn't see a callback, but it may offer that too.)

    I haven't used this product.

    Also consider that if FTP proves to be too hard/expensive, you could always switch to HTTP uploads instead. Chilkat have a free HTTP/HTTPS upload library.