rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

XOR'g with what? A key? If you used a key to XOR your data, then using the same key in the same order to XOR the encrypted data should result in the original plain text. This is cryptography 0.001. And what is the cruft about primes? Describe your algorithm and not the code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is a procedural problem. Think about how you would solve the conundrum. There are a couple of options:

  1. Before appending a file to the data set, forward to the last line and remove it.
  2. After appending a file to the data set, forward to the last line and remove it.
  3. Append each line of a source file to the destination file, and when you find the "End of Report" line, don't write it to the destination file.

Are we seeing a pattern here? To do this, you need to open the file for read+write options, not append-only. It isn't difficult, and definitely not rocket science.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Static functions are class-specific. You can declare/define functions with the same signature for other classes, but static functions either have to be accessed with classname::functionname() if accessed outside of the class, or simply functionname() if inside the class. They are NOT inherited by sub-classes. So, overriding them doesn't work like it would for member functions.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unless you are running a REALLY old computer a 4MB page table can easly fit in contiguous memory, and most modern operating systems will reserve such on boot.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are not BIOS rootkits per se - the BIOS is read-only memory. However, there is a flash chip that holds the current BIOS settings, and that CAN become rootkit infected. This is a favorite tool for agencies such as the NSA and other sophisticated hackers. Even if you wipe and re-image your drive, when you boot up again, if you haven't wiped the flash, then you get re-infected.

Some systems let you wipe the flash by removing the battery (laptops) and holding down the power button for some period. Others require that you remove the battery, access the motherboard, and short out a couple of contacts. Your computer manufacturer will have instructions on how to do such a "factory reset" of the BIOS flash.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Does it only go high when updating, or always after the update?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not ever! Blu-ray is heavily DRM encumbered, and every purchase of a drive and/or disc puts $$ in Sony's pocket, who I will NEVER again support! Stick with DVD's. Yes, BR can provide higher resolution, but not enough to justify Sony's egregios anti-consumer behavior! 720p (DVD quality) is pretty darned good, even on HD TVs. So, just say NO!

My reason for this? Some years ago Sony delivered CD albums infected with a rootkit that bricked and/or infected millions of computers. Did they every pay compensation for this? No. Did they ever apologize? No. As far as I'm concerned, hacking Sony is a public service... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Since these systems are both behind your router/firewall, don't bother with SSH but enable telnet and FTP. SSH will require in some cases that your client is registered with the host account (login ID) that you are using, with its public key. Your client needs to use the private key so that the server can validate you. A PITA, but that's the way it works, which is why for local LAN connections I don't bother with SSH usually.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It may be that the StreamWriter class is buffering the output data and won't write the remainder until you close or flush the stream.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The "speeds" specified in the USB (and other device) specs are the maximum supported speeds. That doesn't mean that devices so attached are capable of those speeds. Certainly, most disc drives cannot support sustained speeds of either USB 2.0 or 3.0, especially for writing. Once the the internal buffers on the drive are full, it will fall back to the maximum write speed of the drive. Given you are probably using the same drive for both USB 2.0 and 3.0 tests, then the 23MBps speed you are seeing is likely the maxiumum physical speed that the drive is capable of.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Create a structure to hold the data. The numeric data can be in an array that is part of the structure. Then you assign the structure as the data part of your linked list. There are singly linked lists (each node has a pointer to the next node) and doubly linked lists (each node has a pointer to the next as well as the previous node). Basically, each node has 2 or 3 elements. For a singly linked lists there are two. One element is a pointer to the data, the other is the pointer to the next node in the list.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That's kind of like starting out trying to do PhD research when you don't even have a high-school education in the subject... Not going to work.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To quote the Beatles, "Help, I need somebody! Help! Help! Help! Help!"... As ddanbe asked, with what?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Visual Stupido - please, just hit me on the head with a brick! There are MUCH better IDE's for Linux and Unix if you need. Even a good editor and Make are (in my mind) preferable!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assembly is direct-to-processor coding and totally not portable. It is only used these days to write processor-specific code for operating system low-level programming. My last assembler coding was about 25 years ago for x86 TCP/IP device driver code. Even since then most of my device driver code for systems such as Solaris, Linux, and other *nixes has been in C or C++.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This isn't really C++ (object oriented) code. What are your classes? What are the member variables they contain? What are the methods to get/set their data values? It is time you went back to the text book...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Consider classes as representations of "things", such as animals, boats, people, etc. Each class will consist of member variables that determine the uniqueness of that object, such as for people that may be name, address, age, etc. as well as methods to set/get the values of those variables such as setName/getName, setAge/getAge, etc. This allows us to view and manipulate our digital world in a rational manner.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

60MBps == 480mbps, more or less. Most hard drives cannot sustain more than that, interface speed notwithstanding. For small files, the speed may be greater, until the drive's write buffer is filled. Then it will fall back to the maximum throughput that the physical drive can handle. You may see better performance if you are writing to a USB 3.0 array where the output can be spread across multiple drives. Don't expect better for a single drive.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just remember, the Internet forgets nothing! If this person is not willing to remove your posts from his computer (remember, they are also likely on other users' systems, not to mention backup devices for the company), then you know what kind of "friend" and/or "mentor" he really is. So, give it up, let your corresponents who you communicated with know that their mail with you has been compromised, and keep a stiff upper lip!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@pritaeas
Myself, I prefer more bigger screens! :-) I have dual 24" 1920x1200 displays that I use with both Linux and Windows, using a KVM switch to move from one OS to the other. Windows runs on a company laptop. Linux runs on my 8 core Intel box.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might want to verify that all the RAM is being used. Some modern motherboards will disable a stick of RAM that is failing. Usually, it will require that the stick in slot 0 (the first slot) is healthy, and map out others if necessary. So, it is possible that swapping the RAM SIMMs helped.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some current malware installs itself in the flash used by the BIOS, and it will re-install itself as soon as you boot and try to install a new OS. The only solution is to wipe the flash memory (some systems allow you to do that by removing the battery and holding down the power button for up to 30 seconds - some require that you remove the battern and short out a couple of contacts on the motherboard - see your system vendor to find out which you need to do to clear the flash memory completely). The BIOS should be true ROM (Read-Only Memory), so it should be OK, but the flash memory is where the BIOS settings are stored.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes. And your question is? What have you tried? If you right-click on the image, it should provide a URL to the image. What did you do with that?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The remote user's ip address has to be registered in the ~/.ssh/known_hosts database. You might want to review the ssh man pages for better understanding of what is needed for remote connection with ssh keys.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are not providing enough information other than you only see one monitor. What does the "Screen Resolution" option (right click on screen) show you? Can it see/detect both monitors? Have you tried a set of DVI cables (assuming the monitors support DVI)?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

They are both 5 volts. One will provide a higher current, hence shorter charge time, than the other. The only thing you need to verify is what the maximum charge rate (amperage) is that your device supports. The 1Amp rate should be safe for everything. The 2.1Amp rate may not be.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FWIW, when root untars a tar file, the files extracted should get the ownership and permissions of the original owner, as stored in the archive. If the original owner doesn't exists on the new system, or has a different UID, then it may appear that the files are owned by another user, or by a UID (User ID) that doesn't exist yet on the new system, such as 5001 instead of "Fred Flintstone".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are not showing enough code, such as how you would create the third file "OutPut3.exe". In addition, even if you did that, the system would probably not be happy as your "executable" would contain two main() functions and it would probably just execute the first found, if it didn't give you a runtime error.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What are the compiler outputs? Are you getting errors? The file "example.txt" should appear in the same directory you run the executable from, not necessarily in the directory where the executable "test" exists. How did you run the executable?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you want real help, please post your code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please post your code if you want real help.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your getter needs to be a const member function as in int getSimulation() const;. Other than that, Moschops is correct in that you need to do argument validation before you set member variables otherwise you have effectively made your private members public. In addition, do NOT use leading underscores for variable or argument names since that construct is reserved for the use of the system. You may inadvertently end up with undesirable consequences... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What James said is 100% correct, but to reiterate, you are not setting the variable diff to some value, assuming input from the user. Hence, it does not match the conditional in your if statement, so it jumps over that block. Fix that and it will probably work.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are also 64bit ARM chips (lower power - not so commonly found), as well as Intel-compatible AMD chips similar in capability to those that SteveDotNet mentioned. ARM chips are commonly used in cell phones and tablets. They are just getting into use for servers.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And this will help with integer roots: http://en.wikipedia.org/wiki/Integer_square_root
It may be more to your needs. Do note that the output still needs to be a floating point value (float or double).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Moschops
I think that CImg would still be considered a "library" for purposes of this student's exercise.

@ameer
I think that displaying a png image would be your best bet as it is open source and structure is well documented. You will need to do some research and determine how to decode and display it, which is what I would think is the purpose of this exercise. Good luck! When you have made some progress and need some help, then post your code and we'll be happy to help.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please show the rest of the code in the function that this conditional statement resides.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Of your own? How "random" do you want the output? There are plenty of texts out there that can explain some of the more common ways. Here is a great tutorial compliments of the US government and my tax dollars: http://www.phy.ornl.gov/csep/CSEP/RN/RN.html

It is one of the best treatises on the subject I have found.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You aren't being very helpful in providing enough information. Showing code and describing exactly what you want to accomplish will generate a lot more comments.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good for you in finding the cause of the problem. Note that in line 3 of your post, it indicates that it would use a default entry point, which is why it ran.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Myself, I won't touch a BR drive to save my life - I refuse to pay Sony a tax for watching videos, and suffer the slings and arrows of heavy-handed DRM (Digital Restrictions Management). However, you can use a Google search to find many reviews of the various units available.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I suspect that the BT adapter is not enabled. If you still have the user docs that came with the laptop, they should tell you how to do it. Also, if you are running Windows, then you should be able to use the device or network manager tools to do so also. Does the device manger or network manager see the adapter?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is it possible that your ISP is throttling your data due to exceeding data caps? You might want to look into that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your main program can poll the files in question. When they get to the requisite size you can fork()/exec() a child process which know it is a child can take the file name and then archive the file in question, terminating when that is finished. So, you could have many children running which may exceed system resources (caveat programmer!), so you need to use one of the wait() functions to be informed when a child dies so the system will not leave zombie processes hanging around.

Another approach is to use the inotify api's to monitor the directories and files in them for specific events that you can specify, which will signal you when it happens. That eliminates the polling. I used this in the past year or two writing logfile processing systems for performance engineering. The code was a mix of C and C++. We were able to process 10 billion data points per day from 5000 systems, each point representing 1 log file line.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do some research on the layout of Corel images. Are they raw? Gifs? Jpegs? Something proprietary? Also, how many bits are represented by each pixel? The format of gif and jpeg images are well documented. Raw images are usually laid out in an array and rectangular images are quite easy to decode. Odd shaped ones require more work.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Back in the 1980's I wrote a seive using an array of pre-computed values from 1 to 10,000. Then using a recursive algorithm I could look up primes with almost linear time, and this was on an old Compaq 8088 with 256K of ram... I used doubles so I could determine if a number was prime up to 15+ digits. I later used that code for some work I did on Goedel numbers, strings represented as the products of prime numbers - very relevant work to breaking public key encryption. I stopped because I didn't have the time to build an arbitrary math module that would have been required to exceed the capability of double precision math - Boost didn't exist back then!

Anyway, I'd post the code here if I had time to dig the floppy it lives on somewhere in my storage space... And I'm not sure I still have a functional floppy drive. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Hard disk checks notwithstanding, this sounds like one of a couple of possibilities.

  1. There is a fault in the boot sectors of the disk. You need to run extended disk checks to see if there is a fault there where it can read the sector occasionally, but not always.

  2. You are getting other hardware problems, such as with the system BIOS and/or flash memory. Most BIOS's can be configured for more verbose POST output which may help.

  3. There is a very serious virus on your system. Some exist that infect the system flash memory where BIOS settings are stored, so even wiping the disk and reinstalling the OS from scratch are futile. This could also cause the BIOS/flash to look faulty as well.

So my recommendation is that you take into a technician who you trust to run extensive tests on the system hardware, software, and firmware. If the system is starting to fail, they will let you know if repairing it is worthwhile. If it is still under warranty, then send it into Compaq for repair.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is just bogus!

if (player == 1 && player != 3)
{
    player = 2;
}
else if (player == 2 && player != 3)
{
    player = 1;
}

Just use

if (player == 1)
{
    player = 2;
}
else if (player == 2)
{
    player = 1;
}

There are better/shorter ways to do this, but let's keep it simple. Your tests for player != 3 are irrelevant.

This is not addressing the rest of the errors in your code, but obviously you need to seriously rethink your approach.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I speak pig latin -> Igspay atinlay. My sister and I spoke it extensively as children in the 1950's. FWIW, this is where you want a finite state machine representation of the transformations needed in order to handle this in a generic manner. Have you studied finite state machines as yet?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Arbitrary precision math. An interesting problem. Look at the source code for the Boost libraries. I worked on this about 30 years ago and gave up for lack of time (ie, I got a job).