rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Exactly! Pass by value means the receiving function gets only a copy so changes to it are local only. Pass by reference means that the actual passed object is received by the function, so changes to it are visible outside of the function. It is much like passing a pointer to the object, but safer since you can assume that the reference is valid, vs. a pointer which you need to check for null and such.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is why we use surge suppressors! Chances are that many components on the motherboard and/or video card were fried with that surge. My system and peripherals are plugged into a UPS that is also a serious surge supressor (industrial strength). Brownouts can cause almost as much damage as a lightning strike surge. My advice is to get a new system and be happy if you can recover your data from the old system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are almost there. Do the code and show us how you might do it. Basically you are adding the values of arr[0][N] and arr[1][N] where N is 0...4.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is not nice to post code with some problem, and then not indicate what/where the problem is. What IS your problem? P.S. NathanOliver was being polite...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Haven't read your text book I presume?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sounds like a school exercise. How long have you been working on this?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I have had a 30+ year career in software engineering, and I have programmed in at least 2 or 3 dozen different computer languages. Logic is logic, and that is the key. Differences between languages are mostly syntax. Once you have mastered one, others will not be much of a problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These days, "upgrades" are not so much an option, and will cost more than replacing the system with a current model - planned obsolescence is the term I believe. Replacement will probably be cheaper, and better...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is #3...

    std::cout << "*" << std::endl
              << "***" << std::endl
              << "*****" << std::endl
              << "*******" << std::endl
              << "*********" << std::endl
              << "*********" << std::endl
              << "*******" << std::endl
              << "*****" << std::endl
              << "***" << std::endl
              << "*" << std::endl;

Just pure C++ code!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I like it Moschops! Keep it simple...

fawadali commented: its not answer of my question +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My new company (Adobe) also issued security-hardened Windows laptops, and since most of my work is in Linux (again), I am running CentOS in a VM there as well. My previous employer was Nokia and all of my development work was performance engineering for Linux servers. Some of my current work is for WIndows servers, so I will probably install a Windows server VM as well so my work won't mung my laptop which has to be used for email, documentation, and all the other usual business cruft. The neat thing about virtual machines is that you can run more than one at a time so I can test cross-platform code and see how it behaves differently (or not) at the same time. I do think I need more memory to do that however! :-)

Dang! Just checked, and I already have the max RAM (8GB).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I have done massive amounts of log file processing in real time (millions of records per hour). Please be more clear on your objectives. What EXACTLY do you mean by "display 1000 logs coming from the server into 20 rows continuously"? You are processing 1000 log files/streams? You want to display them 20 rows at a time? Please elaborate.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A lot of laptops these days do not have a vga port, but either a DVI or HDMI port, though the principal remains the same. Unfortunately, not everyone in these situations has an external monitor that will mate with the laptop. That said, all-in-all the advice in the article is sound.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is the OS (and version) you are running? What is the make/model of the sound card?

In any case, I'd send the card back and get one more main-stream. 5.1 sound cards are easy to get, and not too expensive these days.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

More complex == more comments. If you come back to the code in 6 months and wonder what the fark you were doing, then it wasn't commented well enough!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried using qsort(). It was made for this, unless your professor wants you to implement your own sorting routine.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show your code for index.php and at least one of the other files.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

School work? Or otherwise? Why VB 6.0?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The link that NathanOliver provided has other links to open source code that deals with this. The VRP is a version of the travelling salesman problem. There are no "perfect" solutions, only bad, good, and better ones. Time for you to start studying, seriously. If you have no programming experience, then you are in for a seriously hard time.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is your study area, applied math?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The major problem that one must watch out for when using multiple inheritance is if more than one of the base classes are derived and one of their base classes is the same. Unless you use virtual inheritance, then you get two instances of that base-base class in each instance of the derived class, so if you make a call that is handled by that base-base class, which instance handles it may be unknown, and their state data may vary. Virtual inheritance helps assure that there is only one instance of that base-base class.

Used carefully, multiple inheritance is incredibly useful.

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

Sorry, but we don't do your homework for you. Make an honest attempt, and if we decide to we may help you see the "errors" of your ways! :-) Good luck.

FWIW, this is an elementary queuing problem. Study up on that for a bit first.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The means to clear the BIOS flash memory varies from system to system. Some let you do that by removing the battery and holding down the power button for 10-30 seconds. Some require that you remove the battery and short out a pair of contacts on the motherboard. You need to visit the system manufacturer web site support pages to find out for your specific model. It should also let you know if it has a UEFI BIOS. Those require "signed" operating systems and kernel drivers, though some do allow that "feature" to be turned off in the BIOS. Some do not. You can thank Microsoft for this cruft!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What browser are you using? What operating system + version? Do you have personal firewall software running on the system?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Scalar expressions such as the first is more efficient as every time you do some math (especially division) in your code, it adds overhead. The only advantage here is if you can reduce your search space. In the second expression, instead of n/2, use n>>1, which is the same as dividing by two, but just shifts a register, hence is likely more efficient in time. The only issue there is whether your processor instruction set will drop a bit that "falls off the end", or wrap it around. Caveat programmer! And do have fun experimenting with this stuff.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It may help to show your list structures as well. Also, this is very clumsy code and prone to logic errors. In addition, your lack of appropriate scoping (bracing) of your logic means that the return values are not what you think. Example, this code:

if (t->data == d)
    cout << "found" <<endl;
return true;

Will ALWAYS return true, even if it isn't. This is how it should be scoped:

if (t->data == d)
{
    cout << "found" <<endl;
    return true;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Does this system have a UEFI BIOS. Considering it is a Core 2 Duo probably not. Sorry, but as I have indicated, I have never seen this before. Have you wiped the disc, cleared the BIOS flash memory, and created the bootable image on another system from the .iso files?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are not providing enough information. How are you updating the system, via the standard Windows Update program? Via AMD GPU updates? What errors do you get?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is the make, model, BIOS version, and processor type of the computer you are trying to install on? Also, how did you burn the CD/DVD/USB drives? As I said, these errors make no sense to me and in 15+ years working with Linux on 32 and 64 bit systems (workstations, servers, laptops, netbooks) I have never seen them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C and C++ programming are not easy to learn well - it takes time, study, and practice.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What distributions are you trying to install? These make no sense to me! I believe you have a bogus distribution. Have you tried Debian, Red Hat, Ubuntu, Mint, et al?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I like a good multi-window, multi-tab, language-sensitive editor such as nedit and make. I find that an IDE just slows me down.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can use the command "stty -a" and parse out the number of columns. Example, in my command-line window stty -a shows this:

speed 38400 baud; rows 50; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

Note the "columns 132" entry. That says that my window is 132 characters wide.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The use of abstraction is that you can create an abstract base class with all the functions you need for derived concrete classes of that type, so that you only need a pointer or reference to the base class in order to do useful stuff. I used these extensively in a framework I wrote years ago to model what we called "storage adapters". We had concrete classes derived from the StorageAdapter class for storing data over the network (BusStorageAdapter) or directly to a database (DatabaseStorageAdapter). The application developer only needed to tell the object to store itself - each class knew what storage adapter they were to use. The developer didn't need to know that the actual storage was local or remote. It would do the right thing in either case. If the class used a BusStorageAdapter, it would serialize itself into a data stream and the adapter would send it to the appropriate server. If the class used a DatabaseStorageAdapter, it would bind the object's variables to an SQL statement and execute the statement directly to the database (Oracle, Sybase, et al).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just because code works doesn't mean it is well written! I used to teach advanced C++ programming classes to our engineers from all over the world and covered these issues in depth.
Here is how your constructors should be:

public:
fraction() : num(1), denum(1)
{}
fraction(int n,int m) : num(n), denum(m)
{}

Note the error in your constructor with arguments where you set both num, and denum with the argument n. I assume you meant to set denum to argument m.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

They are totally different animals! Thread-safe means that multiple threads in one executable image can run the same functions without interfering with each other. Re-entrant means that you can have a function that can be recursively entered even before the previous invocation has finished. This is common for recursive algorithms such as computing fibonacci sequences. This does not require a threaded environment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might want to check out Python as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of issues with your post, starting with initializing member variables inside the body of the constructor instead of in the initializer list. Try, try again!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FWIW, the 320x240 is standard vga dimensions and the x3 is the pixel depth. IE 320x240 is the x/y size, and 3 is the number of bits at each location in that array. In any case, 320x240 is pretty miminal these days. My displays are 1920x1200x24 or 1920x1200 pixels, with 24 bits (3 bytes) per pixel - a LOT more data to deal with! It allows mostly true color at full display, but each display takes up over 6MB of memory! Fortunately, my nVidia video card has about 1GB of RAM! Your VGA display would requires 446400 bits to display all that data, which is under 56KB. Not all that much in today's terms.

I have dual displays and can run a full-motion full-screen video on each without problem. Back in the 1980's I was lucky to run some simple video on a vga screen, even using low-level C programming to push the bits. In any case, this is a good exercise for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

NP. Sometimes reading the manual helps... :-) In any case, it was a sensible question for a newbie. Sometimes what is obvious to us "old-timers" isn't so to newer programmers.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The "./" means "use the current directory where your application is running". The dot is the current directory. If it was "../" it would point to the directory above where you are. If it was "~/" then it would point to your home directory.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Again, I ask you to NOT purchase ANY BR device or disc! Sony doesn't diserve a penny of our hard-earned $$!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

BR discs can be played on DVD drives, if not in as high a resolution (720p is maximum for DVDs). DO NOT purchase BR drives or discs! They are seriously DRM-encumbered and will likely not run in the future! Also, each such purchases puts $$ in Sony's pocket, who has yet to recompense us for their rootkit-infected CD's some years ago. Until they pay us ALL for that, I say that NO ONE should pay Sony a penny for their cruft! Just say NO to DRM-encumbered videos and/or devices!

And yes, commerical DVD's are DRM encumbered, but at least they can be easily ripped to enable region-free and non-blocking viewing. It may technically violate US laws, but if it is for personal use only... We have laws that allow "owners" of stuff to do with them what we want. If we purchase a video or CD and don't own it, then what are we paying for?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Class/homework? Sorry. That is why you are in school, to learn how to do this stuff. If you are clueless and have no documentation how to do this, go see your professor.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you mean by "it now usually opens when ever it wants to open"?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Parameters encoded in the URL are called GET variables. These are easily accessible in your PHP code. There are also POST variables that are not in the URL, hence hidden from simple investigation. These are also easily accessible in your PHP code. Go to the php documentation at the php.net web site for more information about these subjects. You should use POST variables for things like passwords or other sensitive information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@HiHe I'm not downvoting you for your response, but specifying a particular IDE (even if you really like it) is not conducive to fixing the problem. Standard compiler and makefile error output will usually be satisfactory. Also, the IDE is often system specific, especially if the user is running on Windows.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C++11 adds a lot of cruft to the older versions of C++ that will leave newbies' brains in a fog. In any case, C++ works with C code just fine. Learn basic C++ and utilize exceptions to handle errors. Use C in your C++ code when you need to get closer to the hardware.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If C, then use quicksort. If C++, then std::sort works, but quicksort is also good, and efficient.