rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You expect us to analyze and comment on 300 lines of code and output? Someone perhaps will, but it won't be me. I see a lot of issues with your code, most of which is just silly stuff. You look at it again, with a critical eye and the lessons you should have learned in class, and try again... Also, indenting your code properly will make it a lot easier to read.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You also don't declare the type of the variable "file". That, and you should NOT use NULL in C++ except for void* types. Use 0 instead. That is valid for any type of pointer. Some compilers will complain about that, especially if warnings are enabled.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are restricted versions you can get from Microsoft directly that are free, but the professional and enterprise versions are only available by paying a lot of $$. Please do NOT ask us to provide you with any proprietary software like this, free or not. We'll provide links to where you can get it legally, but that's as far as it goes. Open source software with appropriate open source (GPL, Apache, BSD) licenses are another thing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C++ allows default values in the declaration/definition of a function, so if there are such, you can leave the ones with defaults out of the call if the default is valid. Example:

#include <iostream>
using namespace std;
// Declaration - may be in a header file.
int someFunction( int a, int b = 0, int c = 100);

// Definition
int someFunction( int a, int b, int c)
{
    cout << "a == " << dec << a
         << ", b == " << b
         << ", c == " << c
         << endl;
    return a+b+c;
}

// Use of someFunction()
int main()
{
    int sum1 = someFunction(100);
    int sum2 = someFunction(100, 100);
    int sum3 = someFunction(100, 100,99);

    // sum1 will == 200, sum2 == 300, and sum3 == 299
    cout << "sum1 == " << dec << sum1
         << ", sum2 == " << sum2
         << ", sum3 == " << sum3
         << endl;
    return 0;
}

This is the output you should see:

a == 100, b == 0, c == 100
a == 100, b == 100, c == 100
a == 100, b == 100, c == 99
sum1 == 200, sum2 == 300, sum3 == 299

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"Java is to JavaScript as Car is to Carpet."

Myself, I would reverse the nouns, as in

"Javascript is to Java as Carpet is to Car." :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Adobe has been working on patching Flash Player to eliminate these issues. In fact, I just got an update for that on my Linux system this morning. Yes, there are vulnerabilities in any software - that is the nature of the beast - but responsible companies will attempt to deal with them as soon as they are informed of them. Yes, most could be more pro-active, but sometimes even with the best people and intentions stuff is missed that malware writers catch.

Disclaimer: I am an Adobe employee. We use Flash extensively in our work, so fixing these problems asap is in our own best interest.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The usual answer is "it depends". Laptops typically use a 2.5" HDD sata drive format. You can install a large (up to 1TB at least) HDD or SSD in place of the SSD that is provided, but you will have to re-install the OS, which if Windows means that you will need to purchase the system with full Windows installation media as well (probably adds something to the cost).

That said, some vendors require that the on-disc controller have a code that is proprietary to them, which means that you would have to purchase a different drive from them, at grossly inflated prices, instead of one from "CheapComputerGear.com".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Having multiple readers of a table simultaneously is not a problem and you should not try to lock the table. Having one read it while another is trying to write to it is another issue. Most database implementations will deal with this automatically. If one is updating, but another tries to read the same record, if the system is set to allow "dirty reads", then the second will get the old version of the table until the writer has committed the changes. If it isn't so set, then the reader in such a case will be queued until the data is committed, but if the reader started before the writer, then it will get the old data, and the writer will be blocked until the read is complete. Basic DBMS stuff. MySQL deals with this pretty well as I recall, but a lot of the behavior is predicated upon the configuration options of the database instance that you are using, and there are a lot of those options.

After reading your second posting on this, it is obvious that there is a "dirty read" situation happening. If you can alter the configuration of the database to disallow this, then you don't need to do anything.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To quote myself - "We don't do your homework for you!". Until you make an effort, post the code here, and let us know what errors or issues you have, don't expect much... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just remember, we don't do your homework for you. Post your best-effort code and we will critique it and help you fix it, but don't expect us to do it for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What tools are you using to generate your PHP? This doesn't happen "auto-magically".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Time to go back to the text book. This is not rocket science, and since you have to ask that question, you haven't been doing your homework... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Viruses that infect a virtual machine should only affect that virtual machine, unless it has some network connection to the host that can let the virus propagate to the host (rare). If your host is Linux, and the VM is Windows, this is unlikely. I use VirtualBox for this sort of stuff, and keep a current snapshot of my Windows VM. If it gets infected, I just roll the image back to the snapshot - voila! No virus!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your code as shown is not correct/valid and you aren't showing enough information, such as your class definitions. Are you trying to define a class inside another one?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Business is business. Some are good at it. Others not so. That said, it is possible to write your own software, especially for mobile apps, and have it sold for you in the mobile device app stores. The cost to entry is not too high, and if your app gets traction it can make you a lot of $$.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To see what is going on, before line 8, put in a printf statement that will output i and j. That may help you see the behavior of the algorithm. IE:

    int i = 1;
    while ( i < 10 )
    {
        int j = 10;
        while ( j > i )
        {
            j--;
        }
        System.out.printf("i == %d, j == %d\n", i, j); 
        i += j;
    }
    System.out.print(i);
JamesCherrill commented: Exactly! That's how to understand it. +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C++ is derived from C, and is fully compatible with C code. It has added classes, templates, references (vs raw pointers), and a number of other advanced programming features that allow you to write very complex programs much more quickly and with less code that it would require in C. As it is, the original C++ was a pre-processor for C, and C++ code would be turned into C code for the C compiler. That was the standard when I started programming in C++ in the early 1990's some 25 years ago.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Linux is NOT Unix, though they share a lot of design features, and support many of the same tools and application sets, though each application needs to be built for Unix or Linux separately.

Unix was developed by Brian Kernighan, Dennis Ritchie, and Ken Ken Thompson at AT&T Bell Labs in the 1970's. They needed a "free" version of the Multics time-sharing computer OS, so they invented their own! The rest, as they say, is history.

Linus Torvalds was working with Minix, written as a university teaching project by Andrew Tannenbaum in the mid-1980's as an example how to build a Unix-like system. After awhile, Linus decided to write his own kernel, and Linux was born. Both Unix and Minix were inspirations to him, and he built upon their work.

FWIW, Kernighan and Ritchie invented the C language, and used it to implement Unix (with some machine-specific assembly language, I'm sure).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

After pulling the battery, hold the power-on button down for at least 10-30 seconds in order to drain the CMOS-Flash memory charge. Just removing the battern is insufficient. Also, some systems actually require shorting out a couple of terminals on the motherboard. Some HP systems require that to discharge the CMOS. My attorney gifted my grandson an HP laptop that was so locked. After removing the battery, he took the cover and keyboard off, shorted out the contacts, and then was able to install Windows 7. Took him all of about an hour to have Win7 up and running. He uses the system to run high-end circuit design tools (retail value, about $50K - he got a legitimate license from one of his clients for work he did for them). I'm a computer geek. He is an uber-geek! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, normally we don't do your homework for you. Of course, you still need to initialize your variables to a sane value. I think Moschops is leaving that exercise to you... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

PAE - Physical Address Extension - this allows your computer in 32-bit mode to access more than 4GB of RAM, although each process is still limited to that.

SSE2 - Here is the Wikipedia article on that: https://en.wikipedia.org/wiki/SSE2

NX - No Execute instruction - helps protect your system from malware.

You can find all of this stuff with simple Google searches. Your processor should be able to handle this, though not sure about NX. Go to the Intel web site and look at the specification pages for this processor.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Install ffmpeg. It is open source (free), runs on most anything, and can convert any format to any other, including .wmv files. Typical command line would be like this: ffmpeg -i filename.wmv -target ntsc-dvd -q 0 -async 20 outputfilename.mpg

The target option is going to convert it to an mpeg2 file suitable to burn on a dvd. The q option says keep the quality/resolution of the original file. The async option says to sync the sound every 20 milliseconds - a good value to keep the lips in sync with the speech. :-) FWIW, ffmpeg will also convert the audio accordingly, although you can tell it what audio format you want, including surround sound.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Everybody has a bad day from time to time. Common questions are often similar in form... Give the dude a break! And Ahmad, this is NOT a pathetic site, but your question was pretty "basic" to put it nicely...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

XML is frequently used to serialize objects and such these days. There are many packages that will help you with that for Java, C, C++, and other languages. And don't forget, you still need to de-serialize it at the other end of the connection. This may not be trivial.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And don't forget to stick your tongue out and flap your arms vigorously while you reboot!

Sorry, I couldn't help myself after these other responses! Do let us know WHAT you need help with. We are not mind readers, but we will do what we can to help you if you let us know what your problem is.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@ddanbe
Fixed price projects... I'm involved in one of those right now. We are working our butts off to make it worth it! Ach, sales people! They will promise the Universe, and then expect the techs to deliver on-time, under-budget, and add some cherries on top!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One is positive, the other negative. Positive and negative charges attract each other. Spyware helps sell antivirus software. Bingo! No spyware... No antivirus! Myself, I run Linux on all of my personal systems, and Windows only in a virtual machine. I have never had an issue with spyware/malware on Linux. Too frequently on Windows. Fortunately, I can rollback my Windows virtual machine image to the last snapshot after being infected and immediately remove the infection.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I love this quote from the M-DISC web site: "This new standard of storage engraves your information into a patented rock-like layer that has been proven to last 1,000 years"... Well, since electronic computers have only been around for a number of decades, this seems a bit of a boast, accelerated aging tests notwithstanding. If you need high-capacity write-once backup media, it may be OK, although I refuse to purchase ANY blu-ray device as it puts $$ in the pockets of Sony who I am boycotting due to their egregious CD root-kit fiasco of a few years ago which they have NEVER apologized for, nor recompensed the people whose systems they corrupted.

FWIW, 25GB is NOTHING these days. I have SD cards that have several times that storage space, and they will probably last 1000 years as well in a protected environment, if you don't re-write them much. AND they are cheaper!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Dell makes some nice laptops for this use. I prefer them to HP because in my experience they have been better at support. Given that my last Dell laptop was purchased in 2006 (9 years ago), my experience is not current... :-) One thing they do provide is an extended warranty from the standard 1 year to 3 years for a nominal $99 or thereabouts. Worth every penny!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My wife is a staff physicist in the computing division of Fermi National Laboratory, doing serious software development for high-energy physics research. Her development systems are Macs, but the code she writes has to be cross-platform to Linux and Unix as well. The GNU compiler, Clang, and such are all available for the Mac, which under the covers is running BSD Unix.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And, if we do his homework, do we get his degree? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is kind of like asking "What is the difference between a Yugo and a Ferrari?" They are both cars. They can take you from point A to point B. One is inexpensive and slow. The other takes a lot of expensive maintenance, but will take you from A to B a lot quicker!

Ahmad Imran commented: the difference i was wanting +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Send it back to HP for repair. As gerbil mentioned, it could be an overheating problem, but the random time to failure makes me doubt that. I suspect you have a solder/connection problem on the motherboard or in the power supply.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you want to run Windows, or Linux? With Linux, most software is free, which in a Windows system is often not the case, especially for video editing software. So, your budget is only for hardware?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, I think you are passing the array in by value (copy) so it won't be visible outside of the function. You need to pass by reference as in:
void mulTable(int (&arg1)[50][50], int r, int c)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Loops have an implicit goto when the terminating condition is met, but it is a compiler construct. Goto's have often been used in lieu of exceptions to break out of a bit of code when an exceptional (bad) situation has occured. These days, most modern languages have exception handling, so instead you would throw the appropriate exception. It is a goto in effect. I think it is still "lipstick on a pig"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Suzie999 says. Don't ask stupid questions until you have exhausted standard search tools...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Making programs in C++... Gee, after 25+ years of C++ programming, I don't know. What tinstaafl said - try some Google searches. There are a lot of good books out there, especially those written by the author of C++, Bjarne Stroustrup.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What ddanbe says. For #2 you need to change the language to Norwegian so it will deal with the extra letters, accents, and such.

ddanbe commented: still have to learn to express myself better :) +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

School/class assignment? Do work first. Post work here. If appropriate, we will critique and help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Keyboard loggers and such are not unknown on Linux systems, but are very rare. Getting them installed is not trivial, especially if you are not running as the root user, and your personal account requires a password to run applications as root via sudo. If you violate either of these principals, then you need to adjust your security policies, edit /etc/sudoers, and NOT log in and run as root! If you do that, you should be pretty safe from malware.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Since this is coming from systemd, I have to assume you are using a new/bleading-edge distribution? Please provide more system information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, most current processors support process segregation, but the OS has to utilize it. Most do these days, including Unix, Linux, and Windows (since Windows 2000). You don't want processes to be able to access memory and other resources in other processes as that would allow them to, accidentally or otherwise, corrupt those processes.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you are using physical serial ports (even via USB) then IP addresses are irrelevant, and not used. You need to connect to the correct COM: port.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your while loop on line 10 is incorrect. It should be while (a>=5) instead of while <a=>5>; Also, you have an extraneous { at the end of your code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Nathan
If they weren't open then I would expect the input and output operators to throw an exception.

@markdean1989
What output do you get if you use cout instead of outfile for the output stream? Do you get sensible values for mathgrade, scigrade, and average. Do you get any output? If not, then you may be getting a divide-by-zero or value overflow error. Also what compiler are you using, and if a GNU variant such as MingW, what compiler options did you use?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is why I don't run Windows except on my company laptop, and that is seriously hardened against stuff like this. I am posting this from Firefox running on a clone of Red Hat Enterprise Linux.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It's all in the physics - acceleration, inertia, vectors. So, if you want help, or some criticism, post your design here. My wife is a particle physicist. I am an EE and software engineer. My grandson designs robotic aircraft that can self-navigate a course and land autonomously - he does all of the design of craft and control systems, designs the electronics, builds the electronics, programs the systems, builds the craft, and then flys it. The rotary craft he builds he can throw out of the window of a car at 40mph and it will self-stabilize, run its course, and then land where he programmed it to after up to an hour in the air. Sounds like NASA could use someone like him!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Why are you worried? Do you think someone is hacking your keyboard/computer interactions? Yes, that is possible, but really unlikely unless you are up to something that the government is worried about, or someone is trying to steal information from your company.

A friend of mine developed a high-security Tempus terminal for the government that could not be hacked. The terminal itself was very tightly shielded from remote scanning, and the keyboard (a common weak point for computers and terminals) did not do any electronic communication with the system. It used passive LED's, shutters, and light pipes (fiber optics) to signal keystrokes to the CPU. No electronics were involved. It passed the most stringent NSA tests on the first try - unheard of in those days (the early 1980's).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Without access to the rest of your code I can only say that yes, you could be dealing with a thread race condition here. You might want to consider using a mutex that will keep a second thread from starting if the previous one has not yet terminated.