Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror

Comment Rational Rose, Enterprise Architect and StarUML (Score 1, Interesting) 200

Enterprise Architect is very nice, since you can do forward and reverse software engineering with it.

However, if you do not have the budget allocated for it, a good compromise is StarUML,
which became very nice and usable lately and has the same "feeling" and menu-driven approach
like the old Rational Rose and Enterprise Architect:

http://staruml.sourceforge.net/

http://sourceforge.net/projects/staruml/files/staruml/5.0/staruml-5.0-with-cm.exe/download

As for Rational Rose, the first original version was very good with some known quirks until it
became IBM Rational Rose and was converted into a "super Eclipse" plug-in.

So, if you enjoyed drawing UML diagrams in the old Rational Rose,
then Enterprise Architect and StarUML are the tools that you are looking for.

And if you do not like to draw with a mouse then Graphviz Dot and a good text editor is for you:
http://www.graphviz.org/Download.php

For tracking issues / documents and schedule,
I can recommend either BugZilla, Mantis or BaseCamp:

http://www.bugzilla.org/download/

http://www.mantisbt.org/

http://basecamphq.com/

As for the actual writing part, your company should already have a good set of Word Templates,
to document the actual Sofware Requirement and Specification (SRS), Sofware Design Document (SDD),
Change Request Document (CRD).

Once, you got those set up, then we mostly use MantisBT or BaseCamp to share, comment and track them.

As for producing code documentation, the choice are: Doxygen, JavaDoc, NDoc, JsDoc:

http://www.doxygen.org/

http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html

http://ndoc.sourceforge.net/

Comment Memory leaks... (Score 4, Interesting) 326

Inside bitfast.h:
long *Tail = new long[65535];
long *Head = new long[65535];

for(n = 0; n < 65535; n++){ Head[n] = 0; Tail[n] = 0; }

Memory leak of 128KB for each time the function "Node* BitFast(Node* HeadNode,long run)" is called.

MISSING: delete[] Tail; delete[] Head;

Furthermore the following is faster or use memset:
long Tail[65535] = {0};
long Head[65535] = {0};

Unless you are running this in DOS16, DOS32 with Pharlap or smaller 8051, 68000 processor, you do not need to use new[] or malloc() for this.

In InsertToList, Node *tmpP = (Node*)malloc(sizeof(Node));
free(tmpP) missing inside FreeList()... no such function

In main.c:
Node *L1 = malloc(sizeof(Node));
Node *L2 = malloc(sizeof(Node));
MISSING: free(L1); free(L2);

In main.cpp:
Node *L1 = new Node;
Node *L2 = new Node;

Instead use (no need to use heap, use stack memory):
Node L1 = {0}, L2 = {0};

Mixing the usage of std::cout and printf() is not recommanded.
Use all of the former or the later, else you will have weird display on some run, unless you flush the output buffer. I suggest you use printf() all the way.
cout << "Ok!!!!" << "\n\n" << "Merge Sort : " << tim1 << " ms\n" << "BitFast : " << tim2 << " ms\n\n";
becomes:
printf("Ok!!!!\n\nMerge Sort : %ld ms\nBitFast : %ld ms\n\n", tim1, tim2);

Furthermore, your implementation of link list, and calling Length(Node*) for every equal is highly inefficient, requires O(n). Store the link list length somewhere when inserting. EqualSplit takes O(1.5n) instead of O(0.5n) because of that.

Something like:

typdef struct LinkList {
  Node  head;
  int   length;
} LinkList;

As a result, MergeSort recursively call itself, which calls EqualSplit every turn.

You should make your header file C friendly, and avoid mixing // with /* */, malloc and new[]

No clue why this header is needed:
#include <iso646.h>  instead of not/and use use ! and &&
before:  if(not p) return NULL;
becomes: if(!p) return NULL;

Finally, BitFast is not recursive; therefore, you should try to find an implementation of merge sort which is not recursive also, so you save on function calls, if possible.

"However, iterative, non-recursive, implementations of merge sort, avoiding method call overhead, are not difficult to code." -- Wikipedia

http://en.wikipedia.org/wiki/Merge_so rt

Your function should be in a file.c or be inline.

Slashdot Top Deals

You will lose an important tape file.

Working...