rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Re. Momerath's comments.

I agree, and restate my previous comment, or to paraphrase Tom Cruise in "Jerry Maguire", show us the money! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You also need to remove the Red Hat repositories. Sorry, forgot to mention that! :-(

You can simply rename them, such as add an extension like .bak

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Neither Kaplan nor UoP are considered legitimate degree granting institutions by most states. So, if you get an engineering degree from them, don't expect any state Professional Engineering Examination Board to accept that as part of the requirements for a PE certificate, no matter how much experience you get. Ditto most any other technical degree from them. Don't waste your money with them. There are legitimate universities that have online and correspondence degree programs that are certified nationwide. Those are worth the $$ you are going to invest.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

ya i know how to compair strings..
avl for mon,tue wed, is

mon
tue
wed

after rotation

tue

mon wed


am i right???
cau u help what is b* tree

Yes. However if you put that in code blocks, the indentation and spaces will be preserved so we can read it better. Ie,

mon
                tue
                   wed    

after rotation

                tue

            mon       wed
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Looks like you are making progress. I don't have time to analyze vijayan121's post yet, but from a glance it should help with performance issues. As for debuggers, it depends upon the compiler and platform. If you are using the GNU compiler suite, there is gdb as well as some GUI front-ends for that, including Eclipse. If you are using Microsoft Visual Studio compilers, then that has a debugger as well. When you compile your code for debugging (-g compiler option), then the symbols are left in the resulting object code, as well as source location information (source files and line numbers). That allows you to do things like set break points at certain locations in your code in order to examine variables, analyze behavior, etc. Anyway, these are tools that every programmer needs. Diagnostic trace statements are inadequate for all but the most rudimentary debugging purposes.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we aren't going to do your homework for you. Please make an effort to solve this problem first, even if it is only a text description of what you think you should do. There are a lot of texts on this subject, and plenty of those to be found on the internet as well. Try googling for "AVL tree".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your symptoms are those of an array index overrun. Ie, when you loop over an array, you are going past the end of the array. You must make sure that you are respecting the size of the array, and the number of actually set elements in it. Review all instances of your accessing an array, and how you create, initialize, and populate it. You will find your problem.

P.S. Running in a debugger can help find this sort of problem. Once you see where it is happening, you will probably pull a "Homer" - doh!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I notice in your SDL_SetVideoMode() call, you are using the SDL_HWSURFACE flag which forces the video rendering in the video hardware memory. Have you tried SDL_SWSURFACE, using system memory instead? It may be that your video hardware doesn't deal with this well.

Never mind! I see you have already solved this. Good for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It sounds like some probing going on. Make sure your web server and other stuff is up-to-date security-wise. CentOS is pretty secure itself. Have you implemented SELinux extensions? That will help keep out baddies. One final thing is that you might post this to the security forum of www.linuxforums.org where there are more lurkers for Linux-specific stuff like this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is just such an egregious invasion of privacy that I am (almost) speechless... It should be as illegal and unconstitutional as it is unpalatable.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume you have a personal computer and/or laptop? Probably running some variety of Windows? Ok. Take that (or one of them, scrub Windows off, and get Linux From Scratch (LFS). It is a book and boot CD that will walk you through the entire process of building a Linux system from souce code, configuring the network, configuring and building the kernel, and a lot of other stuff. You will finish up with a functional Linux system and a great deal more in-depth knowledge of operating systems, tools, and networks than if you took a couple of years of coursework.

Then, get a Linux-enabled router such as the Linksys WRT54G, get the source code for that (available from the manufacturer), and study that to see how routers are configured. Your experience with LFS will give you the knowledge needed to make sense of it all. That router you can then tailor to your home network's specific needs.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Wouldn't you think it's time for a trip to the local college library? Or a least some serious googling... In any case, it should be "object based data model". Using that for google search terms, a lot of useful stuff, including scholarly articles, result that directly address your question.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are also class static variables that can serve this purpose. The result is similar to the namespace solution mentioned by Saith, but probably better. It is not an uncommon approach to this problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

All that macros do is basically text substitution, so this:

#define SEVEN 2 + 5
 
int result = SEVEN * 5;

is really the same as this:

#define SEVEN 2 + 5
 
int result = 2 + 5 * 5;

Applying the order of precedence for numeric operators like this, it is the same as

#define SEVEN 2 + 5
 
int result = 2 + (5 * 5);

since multiplication has precedence over addition. Caveat Programmer!

So, if you want the SEVEN macro to be evaluated as a unit, it should look like this:

#define SEVEN (2 + 5)
 
int result = SEVEN * 5;
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do we get extra credit for helping you? :-)

Write down ALL of the rules to convert Roman to Decimal. Remember though L is 50 and X is 10, whether or not the 10 is added to or subtracted from the 5 depends upon what side of the L it is found. So, LX is 60 and XL is 40. Likewise for other numbers. V is 5, I is 1, VIII is 8, IV is 4, 3 is III, 2 is II, etc. So, what are ALL the rules? The reason why this is extra credit is that you need to use a read-ahead/backtrack algorithm to determine how to apply the math.

Ditto regarding rules to convert Decimal to Roman.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I did this for c++ - testfib.cpp:

#include <stdlib.h>
#include <iostream>

using namespace std;

unsigned long long fib2(unsigned long long n)
{
    if (n == 0) return 0;
    if (n == 1) return 1;
    if (n == 2) return 1;
    return (fib2(n-1) + fib2(n-2));
}

unsigned long long fib( unsigned long long n )
{
   unsigned long long array[n];

   if (n <= 10) return fib2(n);

   for (unsigned long long i = 0; i < 10; i++)
   {
      array[i] = fib2(i);
   }
   for (unsigned long long i = 10; i < n; i++)
   {
      array[i] = array[i-1] + array[i-2];
   }
   return array[n-1] + array[n-2];
}

int main( int argc, const char* argv[] )
{
    for (int i = 1; i < argc; i++)
    {
       cout << "fib(" << argv[i] << ") = " << dec << fib(strtoul(argv[i], 0, 10)) << endl;
    }
    return 0;
}

It would be easy enough to convert to C.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

rubberman, you make a good analogy. But people who are studying computer science are learning much more than mere programming. It is true that a lot of students that graduate with a computer science degree go on to do simple programming but it doesn't mean they weren't trained in other computer science disciplines. Computer programming is just one little part of the bigger topic of computer science. Computer science programs do include a decent amount of classes that teach about design. And some of them include some basic engineering classes. It is for this reason that I believe that those getting a degree in comp sci can later get promoted into engineering positions, especially if they go on to get a master's in engineering.

As a discipline, CS in my mind is a qualifier to be a software engineer. It would qualify the holder to become a member of the IEEE and the IEEE Computer Society. So, I guess that I wasn't being clear. A person with a BS or MS in computer science is (or should be) more than a simple programmer. In fact, Software Engineering as an engineering discipline is still quite new and, as far as I'm concerned, a work-in-progress as a true engineering discipline, unlike electrical, mechanical, or civil engineering that have clear requirements to meet. In fact, a lot of states will not allow a person to declare themselves a "Software Engineer" as they do not yet recognize software as an engineering discipline. That is …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For small arrays, a quicksort will finish in literally nanoseconds on modern systems. Even a high resolution clock only measures in microseconds, so thousands of iterations would be required even to get a measurable value. Also, since the array is already sorted after the first loop, it may take even less time on subsequent iterations. So, you would need to repopulate the array after each loop. So, you might want to use an interval timer that you can start, before the quicksort, stop before you reset the array, and then restart before the next quicksort call. Another disadvantage of clock() is that it wraps around and computing that event adds unnecessary complexity to your code.

So, you should be doing something like this:

create timer;
for (int i = 0; i < nloops; i++)
{
    initialize array;
    start timer;
    quicksort(...);
    stop timer;
}
read elapsed time;

I'd suggest that you look at the clock_settime() and clock_gettime() functions with the CLOCK_PROCESS_CPUTIME_ID (high resolution per-process timer) or CLOCK_THREAD_CPUTIME_ID (thread-specific timer) clock type for this purpose. These are POSIX functions found on all Linux systems. I'm not sure about Windows unless you have the POSIX api's installed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These sort of tests take so little time (nanoseconds) that the clock() function cannot resolve them. Usually what we do is to time a loop calling the function in question for many thousands of iterations. Then we can get a rational timing number which we can then divide by the number of iterations of the loop to get the time for a single call.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And do you want coffee with that meal? Sorry, but read the terms of service for this forum. We'll help you with homework if you make a good-faith effort to solve the problem yourself, but we will not do your work for you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, here they are for you in a zip file. I have also included the epel and rpmforge repositories as they have a lot of 3rd party applications that aren't in the main repos. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The nice thing about standards, is that there are so many...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Given its doubly recursive nature, the only way to speed up a Fibonacci computation is to eliminate as much as possible the recursive nature of the algorithm. I have done that by creating an array of 47 or 93 values (largest numbers you can compute using 32-bit or 64-bit unsigned long integers), populating the first few elements with known values statically, and then computing the rest in an iterative (loop) rather than recursive manner. Similar methods can be used for other recursive algorithms in many cases.

FWIW, computing fib(93), which is 12200160415121876738, takes 0.002 seconds or less on my 3GHz Xeon processor system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@rubberman Your analogy has very good points :)
Compared to the traditional engineering fields, you have some one with a BS(or higher) design it but you have a factory worker or construction worker build it.
This is not the case with Software Construction. It takes a BS(or higher) to design it and it takes a BS(maybe an AA on occasion) to build it.

I am about a year away from a BS in Computer Science. I am in Software Engineering I right now, and will have to take the second one as well. Many of the people in my programming classes are Software Engineers. Really the only classes that I don't have in common with my SE classmates are a few of the higher level classes. Do 3-4 classes really make that much of a difference? Its not like I'm allowed to concentrate in basket weaving :)

Now I agree that an engineer would definitely be in charge of a mere programmer. But what colleges of a BS in Computer Programming?(This is a point I brought up earlier in the thread)

This thread got me thinking about what computing actually means. Normally I don't rely on wikipedia but they quoted from Computing Curricula 2005, which was authored by members of IEEE and ACM(Association for Computing Machinery)

In a general way, we can define computing to mean any goal-oriented activity requiring, benefiting from, or creating computers. Thus, computing includes designing and building hardware and software systems for a wide …
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I've been running Chrome for the past 3 months, and it is ok, but I like some of the features in Firefox better. Chrome is more secure, and faster, but it is a memory pig.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show us what you are doing now.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The IEEE has a certificate in software development, the CSDP (Computer Software Development Professional) certificate. It is a fairly new program, about 3 years on now. Since it is provided and administered by the most respected EE organization in the world, the IEEE, it should be acceptable by any reasonable employer of proof that you at least know how to tie your shoes with software... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Get Bruce Schneier's seminal book "Applied Cryptography". It will help you get a much better understanding what cryptography is and what cryptographic algorithms are.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You use a lot of buzzwords without defining them. Why should I care about OP?

Really. It sounds like a sales pitch for snake oil... :-) The words all make sense, by themselves, but are meaningless I think when strung together like the poster did.

So, advice to the poster - illustrate what you are saying with some concrete examples. Expand your definitions in a more rigorous manner. Don't assume that everyone here understands what you are saying. Keep to the KISS principal when defining terms, and build on your definitions in a coherent and consistent fashion.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, it more properly called the Stable Marriage Problem. Here is an article that may help: http://en.wikipedia.org/wiki/Stable_marriage_problem

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Any1 can tell me abt what are the disadvantages in OO modeling

As far as I'm concerned, there are no disadvantages, and tonnes of advantages. If I didn't apply rigorous OO (UML) modeling to some projects I have done, they would never have been successfully completed. One of those resulted in a US patent for adaptive systems. To say it was complex, allowing the modification of classes in compiled machine code at run time via specification, and a rule-processing language that could reduce many pages of complex C++ code to a half-dozen rules that also could be altered at run time without recompiling the code or even restarting the application servers, would be an understatement. However, by using UML modeling I was able to create the design in a few months, and write the implementation code in weeks. This is now used to run most semiconductor fabs in the world today.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I need an idea to find the completeness and hardness of my program..
how to begin with this work...any idea or links to learn more?..

First, learn what precisely np-hard and np-complete mean in mathematical terms. From your post I doubt you have any clue...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I found this book to be really good for the theory of parsing techniques. I've had it for about 20 years, but it looks like there is a new edition out: http://www.amazon.com/Parsing-Techniques-Practical-Monographs-Computer/dp/1441919015

Of course is was a LOT cheaper then - I paid $39 USD for it in 1990-91.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A software engineer uses rigorous, repeatable, provable methods to design and construct software systems. They are capable of building the most complex systems from scratch that will function as designed. The language used should not matter to them.

A computer programmer knows the syntax of one or more computer languages, and is capable of writing programs and functions in them that are clearly specified in advance. Their software architecture skills are likely to be weak, and probably need a considerable amount of oversight.

So, if you tell a civil engineer that you need a bridge across river X that can carry Y amount of traffic across per hour, and has to handle loads up to Z tons at any given moment, they can go away and come back some time later with a design that mathematically will meet the specifications. You then take that design to a bridge building contractor and their workers can build it to those designs and specifications, with the engineer overseeing their work.

If you tell a software engineer that you need an application server that can process X transactions per second, and store/retrieve Y megabits of data per second, handle requests in Z format, and has to provide 6-sigma availability. They can go away and come back some time later with a design that will meet those specifications (class models, finite state machines, work-flow specifications, recovery mechanisms, etc). Those specifications and models can then be given to a team of programmers who …

Mattox commented: Great Post +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, you show your code (please indent - it will be easier to analyze), but don't say anything about what is your problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is a link to a java implementation of trapezoidal integration methods. It should not be difficult to port to C++ or C: http://911programming.wordpress.com/2010/07/12/java-integration-using-composite-trapezoidal-rule/

Sorry, but I haven't found anything in C or C++ yet.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The most up-to-date requirements list for what we need (this changes every 5min it seems)
Source file edit tracking
reports
Document tracking
and I don't know why, but SharePoint integration

My boss is usually pretty level headed, and he's not afraid to spend money where money needs to be spent, so I have that on my side. However, our current problem comes from the fact that our development burden keeps growing, so we have been bringing on new developers, and now our code is hard to follow, hard to manage, and is now bloating out of control. We aim to use a version control or source control to help us track changes, and to aid in the eventual optimization of code.

Been there, done that, as the saying goes! This is a management problem. In such cases, if the manager of the product line is not technically astute enough to control this process, you are in for a load of hurt! One such in our organization almost destroyed the premier MES for semiconductor manufacturing because he did not have the chops to understand what was really needed to control such an organization and keep it on focus. This was an organization that genereated $120M in revenues annually! Fortunately, upper management finally got a clue, and dropped his ass into the unemployment line... :-( Recovery from that was not fun.

Anyway, encourage him to engage the team in evaluating alternatives so that your organization will get …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sounds like a typical techie reaction to sound management practices. How do you define the "best" solution? Have you weighed the ROI of purchase, implementation, training, maintenance, and such against the "comfortable" solution? Have you considered technical support options? What about scalability and future-proofing?

So please, tell me why you think the chosen solution isn't best for the needs of the OP's company when you're lacking key variables. The manager hates VSS, which suggests that he's not a pointy-hair. Taking advantage of an existing Gold Microsoft partnership despite personal biases sounds to me like good judgement.

Good point Narue. It was how the poster stated it that made me think that his manager was only interested in MS products because of their "Golden" relationship with the company. In my opinion, that is not a well-considered decision. I don't imply that it won't be a reasonable one for them, but there are other options out there, each with its own strengths and weaknesses. These days, I would go for more open source solutions, such as SVN or GIT because of the lesser likelihood of "vendor lock-in", but that's just my take on it. I've used ClearCase and a lot of other souce code control systems over the years. For really complex systems, ClearCase was a very strong solution for a company that is looking for a commercial product.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We installed the trial of TFS 2010, and we're gonna run it in parallel to our existing development procedures, and see how well it works out for us. My boss, despite hating VSS, wants to take advantage of our Microsoft Gold Partnership as much as possible. So he wants us to stay with Microsoft products wherever possible.

Ok. Pointy-hair manager wants comfortable solution, not best solution. Understand that. It's a Dilbert moment...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is this?

Trolling I think.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Ezzaral says, and consider commercial tools as well such as ClearCase. We used ClearCase for a large development organization (one of the 60 largest application software companies in the world) that was spread all over the world (US, Canada, Europe, India, Taiwan, Japan, and Korea), and we were able to manage all of that well with ClearCase. It isn't cheap, but it works very well. We had to support rigorous software development and test/release processes (ISO-9001 certified) on a multi-platform basis - 5+ varieties of Unix plus Windows.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, one thing I notice in your declaration vector<string>words; is the lack of a space between ">" and the variable name "words". It should be vector<string> words; so it can be properly parsed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The title is a take on Douglas Adams' quip in Hitch Hiker's Guide to the Galaxy, when the Earth was about to be plowed under for a hyperspace bypass, and the only really intelligent species on the planet, dolphins, squeaked "Goodbye, and thanks for all the fish!" as they left for parts unknown...

1. I am a bald headed old geek fart (60+) who has been a professional software engineer for over 30 years.
2. I love music, play mandolin in a bluegrass band, and jam old time traditional music, occasionally playing for barn dances and such. I used to play jazz violin as well.
3. I've been married to the same woman for 37 years this April. She is a particle physicist with a PhD in high-energy physics from a major US university.
4. I have been awarded a US patent for innovations in adaptive system software.
5. I am a 20+ year member of the IEEE and am the chairman of an IEEE consulting network.
6. My favorite programming language is C++, but I still do a lot of C programming for Linux and Solaris kernel modules and device drivers.
7. I am a published author of technical computing articles in a number of tech-geek publications, and a chapter in a major graduate level textbook on the design and implementation of application development frameworks, a field in which I am considered an "expert". I am thinking of writing a book on …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, if you have RHEL, but haven't a paid subscription, you can't access their repositories in order to get updates, new drivers, etc. However, that is easily fixed. For RHEL systems the package manager is called YUM (Yellowdog Update Manager). It reads files in /etc/yum.repos.d that tell it where to go to find software to install or update. So, you can go to CentOS or Scientific Linux sites (both of which are free clones of RHEL), and install their repositories for your version of RHEL in place of the Red Hat ones. Then you can happily go own your way without difficulties. FWIW, neither CentOS nor SL change the packages except to make sure that they replace any Red Hat copyright images, logos, etc, so you can be assured that this won't break your system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of differences between static and dynamic (shared) libraries. I'll summarize some of the more important ones:

1. If you alter a static library and wish for your applications that use it to get the new code, you have to relink them. With shared libraries, you just need to restart them.
2. If more than one application uses a shared library, then the code that is loaded into the computer's memory is also shared, so you can potentially use less memory if you have a number of applications running simultaneously that all use the same library or libraries.
3. If you link a static library, only the functions you need are linked into your program. When you link a shared library, when the program runs, the entire contents of the shared library are loaded into memory. This can offset the memory advantage of shared libraries mentioned in #2 above.
4. If you want to distribute the binary version of a program and not have your users plunged into "dll hell", then statically link it. That way (see #1 above), all the required code bits are wired directly into the application.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

WordCount algorithm:

for current character = beginning-of-text to end-of-text
  while current character is white-space
    go to next character
  end while
  if current character is not end-of-text
    increment word count
    while current character is not white-space and not end-of-text
      go to next character
    end while
  end if
end for

This is a pretty simple algorithm, and once you start thinking algorithmically then this stuff gets pretty easy, since translating this pseudo-code into real program code (in almost any programming language) becomes quite simple.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

CentOS (a clone of RHEL) works well and is in wide use for this purpose by many major hosting providers and major businesses, such as the Chicago options exchange. However, CentOS has fallen behind current developments, so if you are interested in a Red Hat Enterprise Linux (RHEL) version 6 clone that is free, try Scientific Linux, available at www.scientificlinux.org and maintained by some of the biggest scientific labs in the world (CERN and Fermi Lab primarily).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have to extaract that file then compile from source.

tar -jxvf filename.tar.bz2

It will than create a folder in the same place you extracted it, once you in there you have to compile it

./configure
make
make install

Generally correct, except for a couple of things. One is that you need to install as root, or use sudo. Second, there are likely a lot of missing dependencies, so either you'll need to disable those features with options to configure, or you will need to install those packages as well (probably from source). If you configure those things out of VLC, then you are going to lose a lot of functionality.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most GUI libraries these days are C++, but as gerard4143 said, you can use GTK or GTK+ which has C language bindings. Any reason not to use C++ in favor of C? With C++ you have Qt, wx, and others that are widely used and very powerful.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is one of those things that the standards allow implementations to "do their own thing" on. A string literal may (or may not) be in read-only memory as a constant. So, gerard4143 is absolutely correct if you want to modify the contents of the string in a platform-neutral manner. Neither gcc nor Turbo are breaking the rules. It's just that the rules are flexible in such cases. Caveat Programmer! :-)

gerard4143 commented: Didn't know that, thanks for the pointer. +5