Friday, May 6, 2011

How can I estimate a Web site build (refresh) when I don't know all of the site's features?

I know there are several estimating questions here, and I have read through most of them, but this one is slightly different. If you're doing a refresh on a Web site, it might include usability enhancements that increase the hours for page production and development. We'll never look at a Web site and say to ourselves the way it is now is the way it will be in the future. If that were the case, then our clients wouldn't be looking for our expertise. Should it always be a requirement to do a team brainstorm before responding to an RFP or creating a formal statement of work? What if those doing the brainstorming are not doing the final work? We can only inventory the current site to a certain extent, and I'm starting to think we should make estimates only for what we know, letting the potential client tell us where we're missing certain elements.

From stackoverflow
  • When you don't know what your estimating, expect the estimation to be inaccurate (and, at best, approximate).

    State your assumptions ("X if we do Foo or Y if we don't").

    State what you would need to reduce uncertainty ("we need to spend an hour with the client to gather requirements before we can provide any estimate").

  • In your proposal, be fairly specific about what you saw on the current web site (how many pages/resources? are they low/med/high complex? What are the high level features you see already existing (i.e. search, security, AJAX, profiles, etc.) and what would you consider adding? Give ranges, rather than specific estimates.

    The more detail you give about what you saw without knowing the requirements will help the client believe you didn't just shoot the proposal through an RFP chute, and that you're serious about the work, without tying you to a commitment to deliver more/faster than you can. Clients do understand that you can't really make a reliable estimate, but the more they believe you have made a serious attempt, the more they're likely to commit their time to helping you understand the requirements towards making a final proposal and SOW.

What is the easiest way to create a overview 'outline' of the most important sections of an app in VS 2005 (VB.net) ?

I want to code in our VB.net to be a little easier to follow both to improve readability and also make it a lot easier to know the best place to put a new bit of code/feature.

Essentially, I'd like to have a 10,000 foot "outline" of the code" with hyperlinks from the outline to the code.

It needs to be portable, so BookMarks won't do the trick (I think). I'm thinking maybe TODO comments. I'd like to create our own Todo style comment like "Outline" or something but that keyword would need to be in the config file for VS as well (but then it's just one thing to keep sync'd).

So something like:

TODO: 1 : App Starts

TODO: 2 : Read INI settings

TODO: 3: Show Splash screen

TODO: 4: Start Lesson (this is educational software)

TOOO: 5: Start Exercise

TODO: 6: Next Exercise

TODO: 7: End Lesson

TODO: 8: AppExit

Any other ideas?

From stackoverflow
  • Have you checked out the Rock Scroll plugin for Visual Studio. It has several of the features that you are looking for.

    Clay Nichols : The logical, operational "flow" or sequence of the program is going to be different than the linear list of code, so this doesn't give me what I need. But thanks, it looks like a cool tool!
  • It seems like you could get quite far with a Whitehorse diagram (VS 2005 class diagram tool) with good annotations on it. I might even go so far as to suggest a sort-order-influencing name. If it's the only class diagram, a good VS dev will feel the pull to see what it has to tell them about the code model.

    If the code doesn't lend itself to the object model with simple, good annotations describing flow... perhaps it needs to be refactored so that it DOES lend itself to that simple view?

    Clay Nichols : That won't work with our code because: 1. a lot of it isn't in classes 2. The flow order doesn't correspond to any order of the classes (alphabetical, etc.). E.g., you might have Registration.Validate, followed by SplashScreen.Start followed by Lesson.Begin, etc. 3. There's no way to "highlight" the sections of the classes that are most important. I.e. if you only want to see the 10 most relevent sections of the code, there's no way to do that.
    Tetsujin no Oni : Definitely sounds like a target for refactoring. Creating classes that make the interaction clearer is definitely where I would attack this problem. Absent a look at the codebase you're trying to outline, I think that the description of the problems with using a class diagram as documentation of the interactions (perhaps of interfaces declared to provide only the interaction parts you want to outline...) highlight opportunities to improve the design.
  • This may be obvious, sorry if I missed the essesence of what you are asking for, but would something like:

    region "application start"

    . .

    regoin end

    help at all?

    Clay Nichols : If we created a bunch of regions like that ("Start", "Next Exercise", "End Lesson", etc.) is there one window where we'd see a list of only the regions that had been identified?
    MostlyLucid : Sorry, been under a serious crunch on a project (need in production monday AM) -- I did not find a way to do that from within VS - however, this tool seems to show some promise: http://www.syntaxia.com/Syntaxia/HomePage.php --I will look around over the weekend - it is a interesting problem -
    Nick Whaley : Maybe if you made the text bigger.
    MostlyLucid : In case you missed this one: http://www.devexpress.com/Products/Visual_Studio_Add-in/index.xml
  • I was working in some old VB6 Code and thought of this method:

    Create a Sub CodeOutline ( Order as Double, Description as string)

    Then call it at various places in the code:

    CodeOutline 1, "App Starts" CodeOutline 2, "Load Settings" CodeOutline 3, "Start Lession" (this is educational software to it has "lessons and exercises" CodeOutline 4, "Next Exercise" CodeOutline 5, "Lesson Finished"

    Now you can do a couple of things:

    1. In the above Sub you can put a debug statement. (We have a "debug mode" we can put the app in where any debug message will be reported as a msgbox).

    CodeOutline (Order as double, descr as string) SysMsg cstr(Order) & " -" & Descr, Msg_Debug end

    1. You can also put a breakpoint in the CodeOutline

    2. You can search on CodeOutline and get a list (often sorted by the Order paramater if you're using the MzTools's vb6 addin search function (far superior to the built in vb6). And the search results are hyperlinked.

    EXAMPLE OF THE SEARCH RESULTS

    Tutor
       Modules
          COMMON (COMMON.BAS)
             Sub Main()
                CodeOutline 1, "Startup"
                CodeOutline 6, "Checking Registration status"
                CodeOutline 4, "Loading Splash Screen"
             Public Sub CodeOutline(Order As Double, sDescription As String)
                Public Sub CodeOutline(Order As Double, sDescription As String)
                '   do a Search on CodeOutline  to see all the code outlines
                On Error GoTo CodeOutline_Error
                CodeOutline_Error:
                sysMsg "Error " & Err.Number & " (" & Err.Description & ") in procedure CodeOutline of Module COMMON" & ",," & Err.Description, MSG_LOG
          IO (IO.BAS)
             Sub APP_INITIALIZE()
                CodeOutline 2, "Initializine App"
                CodeOutline 3, "Exiting from App_initialize"
       Forms
          frmSplash (SPLASH.FRM)
             Private Sub Command2_Click(index As Integer)
                CodeOutline 4.1, "User Clicked button # " & index & " on Splash screen"
             Private Sub Form_Load()
                CodeOutline 5, "Exiting from frmSplash.Load"
             Private Sub tmrUnload_Timer()
                CodeOutline 6, "Preparing to unload the Splash Form, tmrUnload"
    

SIFR Font tweaking a nightmare!

Hi All,

I've been trying to tweak my SIFR navigation. I'm replacing with Gill (although I've had the same issue with other fonts).

The problem is that no matter what I do with the letter spacing, short words are ok with one setting but not long words and vice versa.

In order to stop any words wrapping I have to set letter spacing to 1px (for example) but this then causes the larger words to have a much bigger movie than they need and as the nav is horizontal this pushes the next item too far over to the right.

Has anyone had the same issue? And if so, did you solve it?

See image here: http://www.glg-group.com/gill.jpg

It's driving me crazy!

Many thanks

Tom Gosling

From stackoverflow
  • Sorry for not directly answering your question, but you may want to try Cufon

    Cufón aims to become a worthy alternative to sIFR, which despite its merits still remains painfully tricky to set up and use.

    Hope it deals with the issue.

    Rex M : Cufón has legal questions which have not yet been resolved.
    ohnoes : Could you provide more information please?
  • If you use sIFR 3 you can add the fitExactly: true parameter for the replacements, this will make the Flash movies exactly wide enough to fit the text.

    (With the caveat that Flash might use incorrect values, but you can use the offsetLeft/offsetTop and tuneWidth/tuneHeight parameters to tune the text position and movie dimensions.)

Does Delphi sometimes revert text form files (DFM) to binary format?

Our Delphi 7 development team stores form files (dfm) in text mode, and uses a source control system (Subversion) to track changes.

Sometimes, we noticed that a form file returned to binary format between revisions, causing diff tools like TortoiseMerge to complain.

Using the Subversion change log, I can see that the DFM file was stored in text form before. The software developers never change the storage file format back to binary manually.

Have you encountered the same? Is it a known problem?

From stackoverflow
  • If someone has opened the project with different version of Delphi (or changed the default settings), he may save the forms in different format.

    mjustin : Good hint, I will check this. We have also Delphi 2007 and 2009 installed. The default settings are only for new forms, so I am not sure how they can affect existing forms.
  • No, I've never seen (or heard of) this happening on it's own before. We have hundreds of .DFMs in a couple of dozen apps, and this has only happened when some idiot accidentally right-clicks on a form and unchecks 'Text DFM' on the context menu.

    mjustin : Maybe it was the infamous 'right click and uncheck text dfm' virus? ;)
    Ken White : Nah... Our AV software would have caught that. It was an idiot.
    mjustin : Is it Delphi 7?
    Ken White : We have a mix of Delphi 7 and 2007 (I'm the only one who's moved fully to 2009).
  • I have seen it happen in Delphi 7 when a form inheriting from another form from a different project was opened in Delphi on its own without the project it belongs to being open.

  • We've certainly encountered this. We use D7 exclusively.

    Never got to the bottom of it as it happens only half a dozen times a year or so, and although it's a nuisance it's fairly easily remedied.

    I was interested to see Lars's answer, and will certainly look to see if that's a possible cause next time it happens.

  • You may be interested in investigating the use of Beyond Compare instead of TortoiseSVN's built-in merge tool. Beyond Compare is written in Delphi, and natively knows how to read binary DFMs. This means that it then becomes less of an issue (or even no issue) whether your DFMs are stored in Subversion in binary or text. Beyond Compare V3 also does 3-way merging which makes it really easy to merge multiple commits etc. Even ignoring the ability to diff binary DFMs, it's still a much better diff viewer than TortoiseSVN's built-in tools. I can highly recommend it, and it's very inexpensive (I have no connection with Scooter Software, other than being a very happy customer).

    Scooter Software

  • This sometimes happens when the IDE gets confused.

    It usually starts after you got an access violation inside the Delphi 7 IDE.

    Sometimes also one or mor of your Delphi editor buffers inside the IDE become readonly (while the files on disk are still read/write).

    The behaviour occurs much less than in Delphi 5 or 6, but sometimes it does occur in Delphi 7.

    The best thing you can do is restart the Delphi 7 IDE as soon as you get an access violation.

  • We also have this issue from time to time, and it seems to be related to looking at the DFM's source (Alt-F12) and then doing a Visual Source Safe operation (e.g. check-in).

  • This does happen in Delphi 7 but is fixed in later versions. Usually you access forms in the IDE by opening the .pas file and then switching to the Form View. Right click your form and it will show that it is "Text DFM" ticked if you have done this before.

    You will experience the problem you have described of a text DFM switching to a binary DFM when in the Delphi 7 IDE you open the .dfm file directly. eg. File->Open->Somefile.dfm .. Right click the dfm and choose "View as Form". Now right click the form, you will see that the "Text DFM" is unticked.

    We were getting the problem when we opened up a DFM which was a grep search result. It had us perplexed also, and would cause corruption of the dfm in cvs as it was checked in as text.

First Column of a Grid is the headers?

Is there a way (using jquery, yui or some other js library) to display a grid that has the headers in the first column?

That is, I would have something like:

Name       Geoffrey
EMail      GMan67@..
Username   GJFM

Instead of:

Name      EMail      Username
Geoffrey  GMan67@..  GJFM

G-Man

From stackoverflow
  • What you are wanting to create is called a pivot table. I'm not aware of any out of the box solutions for this though.

  • Yes there is a way to do it, it took me an hour to write but It was a nice exercise :)

    This will switch headers and columns inplace. And it works both ways. i.e. you can use it to switch the two styles back and forth.

    // number of columns
    columns = $('table.flipme th').size();
    // number of rows minus one to exclude the header
    rows = $('table.flipme tr').size() - 1;  
    $table = $('table.flipme');
    
    // Add rows to the table to equal the number of columns
    while (rows < columns){
        $table.append('<tr></tr>');
        rows++
    }
    
    // flip in place and mark the old rows and
    // columns as a duplicate to be removed
    for (i=1; i<=rows; i++){
        $('tr')
        .children(':nth-child(' + i + ')').addClass('delete')
        .clone(true).removeClass('delete')
        .appendTo('tr:eq(' + i + ')');
    }
    // remove dublicate
    $('.delete').remove();
    

$html-link() using onmouseover

Trying to use an onmouseover event

echo $html->link("Dashboard", 
     "/dashboard/index", 
     array("onmouseover" => "Tip('Test');") );

becomes

<a href="/dashboard/index" onmouseover="Tip(&#039;Test&#039;);">Dashboard</a>

How do I prevent the link function from removing the single quotes?

From stackoverflow
  • This should work:

    echo $html->link("Dashboard", 
         "/dashboard/index", 
         array("onmouseover" => "Tip('Test');"),
         array('escape' => false));
    
    Jack B Nimble : added onclick="return confirm('Array');" after the onmouseover. It went into the confirm return true/false parameter of link.
  • Using Cake 1.2, this should definitely work:

    echo $html->link('Dashboard', '/dashboard/index',
    array("onmouseover" => "Tip('Test');"), null, false);
    

    The last parameter is the escape option. It defaults to true.

exporting tables to excel / word using POI

i want the code to export tables/ reports to excel and word uisng POI i saw the examples that came with POI but cuoldnot understand.Can anyone provide me a small/easy code to do the same.

From stackoverflow
  • Seeing as you wanted actual code for using POI. Here is some to do some exporting:

    import java.util.Date;
    import java.util.List;
    import java.util.ListIterator;
    import java.util.StringTokenizer;
    import java.io.*;
    import org.apache.poi.hssf.usermodel.*;
    
    
    public class XLSExporter implements Exporter {
    
        /**
         * Constructor for XLSExporter
         */
        public XLSExporter(){
        }
    
    
        public void exportFile( File f, List o ) throws IOException{
    
            HSSFWorkbook wb = new HSSFWorkbook();
            FileOutputStream fileOut = new FileOutputStream(f);
    
            HSSFSheet sheet = wb.createSheet();
    
    
         ListIterator it = o.listIterator();
    
            //Construct the headings
            HSSFRow headingsRow  = sheet.createRow((short)0); 
    
    
            //Heading format
            HSSFFont headingFont = wb.createFont();
            headingFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
            HSSFCellStyle headingStyle = wb.createCellStyle();
            headingStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
            headingStyle.setFont(headingFont);
    
    
            HSSFCell headingA = headingsRow.createCell((short)0);
            headingA.setCellValue("Heading");
            headingA.setCellStyle(headingStyle);
    
    
    
    
            int i = 1;
            // Iterate over the rows
         while(it.hasNext()){
    
    
          //Create the row
          HSSFRow row  = sheet.createRow((short)i); 
    
          //Write data
          HSSFCell cellRunway = row.createCell((short)0);
          cellRunway.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
          cellRunway.setCellValue("Whateva");    
          cellRunway.setCellStyle(standardStyle);
    
    
    
          i++;
         }
    
         //Set the column widths where needed
         sheet.setColumnWidth((short)1, (short)4000); 
    
    
            wb.write(fileOut); // Write the workbook
            fileOut.close();
        }
    
    }