rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to push all of your site data into a tarball, install the required software in the new hosting site, move the tarball to the new site, extract the data, and start testing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes and no. Apple systems used to have additional hardware such that it is difficult to install their software on non-Apple gear. Here is a link to help you do this: http://www.redmondpie.com/how-to-install-os-x-mountain-lion-hackintosh-on-a-pc-tutorial/

Do note the salient point 3:

Requirements:

1. Access to a Mac to download OS X Mountain Lion from App Store and prepare UniBeast USB Drive.
2. A minimum of 8GB or larger USB flash drive.
3. A PC capable of running OS X Mountain Lion.

Have fun, and good luck.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Leave off the trailing '/'. IE: ls -l python*
Assuming that the directory is not a soft-link, then you will see the contents of the directory (or directories).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, besides you are not coding the requirements regarding abbreviations, what problems are you having?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Hiroshe said. Also, file name extensions are conventions - they really don't mean anything. You can rename any file with a .zip extension, but that doesn't mean that it is a compressed zip file.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Bad code. Your Line objects are on the stack. Even though you call the destructor, until something else overwrites that memory, the length value will still be in memory, and unchanged. Try setting length to -1 in the destructor, and then see what is printed.

Also, read up on the scoping of automatic variables, which is what straight1 and straight2 are.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Hiroshe has some great suggestions. Myself, of those I would suggest the low-power real-time OS (having worked with embedded real-time systems for 30+ years). Look at Thoth (the original research micro-kernel OS that QNX came from), QNX, and other such systems. FWIW, a micro-kernel approach with message-passing between the kernel and drivers, applications, etc. provides the best (in my opinion) possibilities to minimize power consumption in a system.

In any case, for any of these options, research is required. That's why it's called "computer science". :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can't "fix" bad disc sectors. Most modern drives have the ability to map bad sectors to spare sectors, but once a disc starts to go bad, those get used up quickly and when you get an error like this all you can do is to backup all the data you can, realizing some cannot be recovered.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try using Firefox, Chrome, or Opera instead.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Homework? There are many resources on the Internet to help you do this. Post your code here, and then we can possibly help you deal with problems that you may encounter. Also, your post is not clear. Do you want to compute the standard deviation of an array of numerical elements using a function?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Did you install Windows first? You need to do that since it thinks that it owns the system. Then you install Linux and it will adjust the boot loader accordingly. A problem can occur if you install a Linux OS using grub and then one with grub2, in which case you may have some manual configuration to deal with. However, since you have Windows 7 on one drive, Windows 8 on another, and only one Linux OS the problem is whether or not Windows 7 and 8 support multiple Windows boot images. Myself, I install Linux as the host OS and run Windows in virtual machines. Much less trouble over all.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The latest PHP versions (5.5.x and later - I used 5.5.4) also have a web server embedded in the CLI, so you can use it and access your code via a web browser. Works really well for testing code (or teaching yourself PHP) without needing to install and configure Apache or whatever.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. Show your code, and be more clear about what the intention may be. Your last comment was better, but you need to be more complete.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Each tab open in Chrome creates a new system process, and uses a lot of memory. This is the most common cause of such behavior as the system may have to hit the virtual memory swap space. Try closing other tabs or add more memory to your system.

FWIW, I switched back to Mozilla (Firefox) because of this issue.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. The mysql_connect() function returns a resource if the connection succeeded, or boolean false if not.
  2. Use the mysqli api's for MySQL connectivity - the mysql functions are deprecated for more current PHP versions.

Your updated version is more correct. Your problem regarding the "access denied" error is in the permissions in the database for your user ID. This has been a PITA for me as well in the past, and altering the user id location so that instead of @'localhost' it is something like @'*', so you can log in from anywhere.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Remember, we won't do your homework for you. You need to make a good effort to solve it, and when you run into problems that you cannot solve, then post your code here for us to review and critique.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, ping is a UDP protocol. There is a message format. You need to format a ping message, open a reply port, and send the message (with reply port) to the IP address using UDP, and then wait for the reply (usually using the select() function). You will need a timeout with select so you can continue sending pings until you reach some failure (or success) threshold and quit sending to that IP.

So, you have a lot more work to do in order to get this functioning. One alternative (faster to implement) would be to utilize the system() or exec...() commands to execute the system's ping executable directly for each IP address. You will still have to parse the response data to determine if ping succeeds or not.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I use Debian for embedded systems work (ARM chip sets), but Scientific Linux (an RHEL clone similar to CentOS) for both my laptop and workstation. SL has been exceptionally reliable and I only reboot when I have installed a new kernel. To get the laptop WiFi working properly, I had to go to wireless.kernel.org but they had all the appropriate links for the driver and firmware, and good installation instructions.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Contact Microsoft to see if you can get a replacement. It will cost you, but probably less than a new CD/DVD and license.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Antenna design is a dark art. I studied software genetic engineering with a very bright US Air Force captain at MIT who was using genetic algorithms to help design phased array radar antennas. He ended up with some very strange designs that out-performed anything that mere humans had come up with to that point...

All of that aside, I personally prefer WiFi devices with high gain external antennas. I replaced the external antennas on my Linksys router/access point with high gain antennas and found it just about doubled the range of the device. Before that, I used a range extender, which worked ok inside the house. Now, I don't use the extender any longer.

FWIW, house construction materials will significantly impact the range of WiFi devices. My house has aluminum siding, which makes it a poor man's Faraday cage, blocking most radio signals from getting out, but also from getting inside. IE, I can't get reliable cell phone coverage inside the house, so if I want to check my voice mail or make a cell phone call, I have to go out on the porch!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The key to learning C++ (C with classes) is to learn how to code in C first. Then, get a grip on object-oriented design (classes, methods, etc), and then on C++ STL (Standard Template Library) tools. This is not a simple process, and will take a couple of years to master to some degree.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The 4096 cores is a limitation built into the kernel. If you want to modify the kernel, you could increase that. There are Linux supercomputers that have lifted that limit considerably - not a task for the noobie kernel hacker... :-)

As for the 128TB RAM limit, that is probably due to the fact that the x86 architecture is still a segmented one. Each segment has 48 bits, and 16 bits (of the 64-bit register size) is reserved for the segment. You can use 64K x 128TB of RAM, but you would have to implement the segmentation code in the kernel yourself. Having done this in the deep dark past of i286 processors, I can testify that it is a real PITA.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

http://en.wikipedia.org/wiki/Simultaneous_equations

Please do your own homework... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, you are popping a value off of the result stack BEFORE you pushed anything onto it. This is the cause of the error there. There is nothing to return to you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Computer/phone/tablet gear is very subjective. Try them out at the store (provided you have a store with the devices in question) and then decide which works best for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

?Huh? Try a Google search? In any case, you are not being clear enough to give rational advice.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try Linux? Windows 7 was decent. Windows 8+? Not so great. Caveat emptor (buyer beware)...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unless you have the tools required to fix a cable, it is not worth fixing. Replace it with a new one.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please be more specific about what your problem is. Does the WiFi work with Linux? How are you tring to connect to your Windows 7 system?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Windows comes with a lot of unneeded cruft and services installed that take up memory, and don't give you much benefit. This ends up causing such performance issues, even if there are no viruses on the system. So, remove or disable all unneeded applications and services and see if that helps. A lean system is a clean system... :-)

Also, many anti-virus applications perform "on-access" scanning, which means that if a file or program is opened, it is scanned for viruses. This causes major performance issues, such as you have experienced.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try

int main(void)
{
    vector<string> activities;
    activities.push_back("a new activity");
    cout << activities[0] << endl;
    return 0;
}

You don't need to pre-size vectors in c++. They will grow as needed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Hiroshe said. Asking us to analyize over 1000 lines of code is not particularly useful... and you don't ask any relevant questions or describe the errors you are encountering.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, you are confused... :-)

The ostream& operator<<(ostream& output, classname& cn) returns a reference to the output object, allowing multiple outputs to the same stream in one expression such as cout << "foo" << "bar" << " " << dec << 1001 << endl;, which would display "foobar 1001". Your example of foo&() {...} is invalid on the face of it. Your compiler should give you an error about that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Convert input to either upper or lower case.
  2. Assuming lower, see if the answer is "yes" or "no".
  3. If neither, then execute the "not a valid answer" branch.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Does your computer have a static IP address, or is it getting a dynamic (DHCP) address from the network? If dynamic (such as a laptop would use), then you need to be sure that the DHCP server is properly allocating an address for your system. If not, then it is possible that it has run out of addresses to use.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, your addrec() method has no code, so it won't do anything...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is it possible with DOS compiler or need vc++ like
new one

What OS are you using? If DOS/FreeDOS, you should still be able to get the ODBC C libraries. If VC++, then it should not be an issue. You can also use open-source compilers on Windows such as MingW (a GNU C/C++ compiler) that will work with ODBC as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your last exampe, 1 3 5 7 2 1 4 3 is incorrect. It should be 4 odd, 2 even, 1 odd, 1 even, 1 odd.

And to answer niranga's question, the answer should be 1 odd, 1 even, 1 odd, 1 even, 1 odd, 1 even, 1 odd... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Either you purchase an installation or live CD/DVD disc set, or download an installation or live CD/DVD set of ISO images to burn to CDs or DVDs, boot that, and install the system. Most distributions have means to purchase installation media (DVD usually) online if you don't want to burn your own media. Myself, I usually burn my own from downloaded ISO images. It costs me about 50c (in US $$) plus the download time. A 4GB image will take me about 2 hours at 5mbps download speed. If your internet connection is slow or data capped, then purchasing the media may be a better option for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You shouldn't lose the data unless you drop/cancel the account. Just disconnecting from it should not do that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I learned software engineering by doing. My first real project was to write an accounting application for a customer (I was a sales representative at a computer store) in dBase II over 30 years ago. He provided the specifications, and I learned the dBase language in order to deliver what he wanted. It worked out so well, I went into full-time software development and have been there ever since! FWIW, that accounts receivable program (and the subsequent general ledger and accounts payables that I wrote for him) ran his business for the next 20 years! :-)

Slavi commented: 30 years ago, wow amazing ..! +3
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

An 8 bit value, such as a char, can be signed, or unsigned. So let's look at chars - you can have a signed or unsigned char. The top-most bit for a signed char is the sign. If set, the value is negative. If not, it is positive. In this case, we have only 7 bits for the actual value (plus the sign bit which == -1).
00000001 == 1
00000010 == 2
00000100 == 4
00001000 == 8
00010000 == 16
00100000 == 32
01000000 == 64

Add them up (1+2+4+8+16+32+64) and you get 127.
if you have 10000000, then you have -1. If all the other bits are set, add them up (negatively) and you get -128.

On the other hand, if the char is unsigned, then 10000000 == 128, so if all bits are set, you get 255. This rule applies to larger integers such as 16, 32, and 64 bit values as well.

Are we sufficiently confused yet? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Use PHP for webapps. It is a derivative of C++, so learn C++ first, and apply the object-oriented principles you learn there to your PHP code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Both solutions are brain-dead... Use bsearch() and utilize a different compare() function for ascending vs descending orders. That way, you only need to tell the program how the list is sorted, and it can call bsearch() with the appropriate compare() function. Simple, effective, and fast.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is the purpose of the ODBC libraries - they provide a database-neutral means of accessing most any database without changing your code. Before ODBC existed, I wrote an ODBC-like API for manufacturing systems, and a set of loadable shared libraries for each supported database (Oracle, Sybase, Informix, Ingres, and Interbase) that accomplished the same thing. Trust me, you don't want to reinvent that wheel! But, it worked great, and is still in use in a number of major manufacturing cell control systems 25 years later.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also this:

int uch = toupper(ch);
if (uch >= 'A' && uch <= 'Z')
{
    // This is a letter.
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you mean by "a repository"? Something like Git, SVN, ClearCase, etc?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is a good tutorial on the subject of random number generators: http://www.phy.ornl.gov/csep/CSEP/RN/RN.html The math requirements aren't too onerous, and translation from the Fortran90 examples to C or C++ shouldn't be too difficult. My wife is a particle physicist and Monte Carlo routines and RNG's are her life blood. Most such physicists have migrated from Fortran to C++ some time ago, especially utilizing libraries such as Boost for higher-level maths, unlimited precision arithmetic, etc.

Two great quotes:

Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. -- John von Neumann (1951) 
Anyone who has not seen the above quotation in at least 100 places is probably not very old. -- D. V. Pryor (1993) 
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, we don't do your homework for you. If this is job, not school related, then Schol-R-Lea's response is 100% correct. FWIW, in Linux systems, there are timer functions that will help you do this very easily. I have frequently used them in the past. Most are POSIX functions, so should work with Windoze as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Class assignment? Sorry, but the terms of service here do not allow us to do your homework for you. Make a good attempt to solve the problem, and if you have errors, post the code here, which we can then critique and help you with (to a point).