rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are correct in that the protected: declaration in class Tank does nothing. You could put static or instance methods or variables there, but since it is only succeeded by public: that is what access will be granted to following elements. Do note that you can multiple public, private, protected sections in a class header.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are ample e-commerce packages that will do what you want. Nothing is free. You either pay in $$ or in time and effort.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, dinad's change is legitimate since there can be negative numbers in the array, and if they all are, then my code would not provide the correct answer. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I seem to recall there were some problems with that update. Have you tried updating with the current patches?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The main distinction, which decepticon was trying to get across, is that each member variable in a struct has its own memory within the structure, and the structure size is the aggregate of all the member variables. A union is only as big as the largest member of the union. So if you have a struct like this:

struct foo {
    int x;
    char* y;
    double z;
};

The size of struct foo is sizeof(x)+sizeof(y)+sizeof(z). However if you have this union:

union foo {
    int x;
    char* y;
    double z;
};

The size of union foo is the largest of these elements, which depends upon the system architecture. The size of x would be likely 32-bits, z would likely be 64-bits, and y could be anything from 32-bits to more than 64-bits, unless you are programming an 8 or 16 bit embedded processor, in which case they will be smaller. So, assuming you have a 64-bit system, then the size of union foo would be at least 64 bits, and the size of struct foo would be at least 32+64+64, or 160 bits.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what is your problem? Please be specific and show examples of why these methods aren't working for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Does it work? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might also try /sbin/fsck.xfs, though I would suspect that it converts that into a call to xfs_repair. It may be worth a try, however.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. The loop for(i=0;i<=4;i++) should be for(i=0;i<4;i++)
  2. You should set a 'largest' variable as found and then output that after the loop has terminated. Following is how to do that.
  3. You also have a bunch of other issues that should make your compiler throw up...

    #include<iostream.h>
    int main(void)
    {
        int arr[4]={23,38, 81,12};
        int biggest = 0;
        for(i=0; i < 4; i++)
        {
            if(arr[i]>biggest)
            {
                biggest = arr[i];
            }
        }
        cout << "largest integer is" << dec << biggest << endl;
    }
    
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Don't know. My wife just upgraded to Mavericks. I'll repost here if she has similar issues. Myself, I don't use Apple cruft. My wife on the other hand is an Apple fan-girl... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'm not familiar with this tool, but since it is generating binary executables my experience shows that when it works in debug mode but not production mode (segfaults, etc), it is due to the fact that debug mode pads arrays and such with extra memory. As a result, you might consider buffer overflows as a cause of this problem. IE, you need to analyze your code to see if you need buffer and array sizes to accomodate string terminator (null bytes) and similar.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of methods to do this. There are native MySQL API's for C, ODBC, etc. Go to the MySQL web site for all the information you need: http://dev.mysql.com/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Put #endif // !RoomOne_H at the end of RoomOne.h and don't include RoomOne.h in StoneAdventure.h

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The question is whether it has really stopped charging, or if just the charging icon is not being properly updated. With the battery fully charged, try running the game long enough that if it isn't charging when you stop running the game (shut it down completely), you will see that the battery is no longer fully charged. If that is the case, and only this game causes the problem, then it is something in the game software that is telling the system to stop using the external charger (or to use battery only). In such a case, you need to report it to the game developer.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The main point of LFS is to teach people the inner secrets of configuring and building Linux systems from scratch (so to speak). If you want a light-weight apache server, then it would be better to get a light-weight Linux distribution and install apache and necessary other components there. Gentoo is a good choice (but will still make you tear your hair out most likely) in that you can configure it for just your hardware and install just the software you want. I have done that in the past and it was small, fast, and reliable. It had no drivers that were not needed, and only the software I wanted (aside what is necessary to run the system).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If your laptop is showing no connections (ssid's) active at all, then there is either a hardware or software problem with the laptop. First, shut it down completely. Then, after a couple of minutes try rebooting. If it works then, it is probably a software issue, which can happen if you typically sleep or hibernate your system instead of shutting it down cold. If not, then your WiFi is broken and needs to be replaced. On most laptops, it is an internally connected USB device. If out of warranty, you might be better off getting an external WiFi dongle which won't be too expensive and should work just fine.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What kind of graphics card does your system use?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most old keyboards are what were PS2 boards and plugged into a round port in the back of the computer. If your computer doesn't have such a port, then you can get a PS2 to USB adapter for a few $$ from most online computer gear suppliers such as Rakuten (formerly Buy.com), Tiger Direct, and others. Here is an example: http://www.rakuten.com/prod/usb-male-to-ps2-ps-2-female-for-keyboard-mouse-mice-adapter/226169506.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but though I have quite a bit of experience working with Wireshark (and the associated tcpdump tool), I have not knowleged of (that I am aware of) of .pcapng, and certainly no experience with .json formats; however, it wouldn't take me long to figure them out, which is what you need to do. This may take a bit of effort, and/or google searches to find some appropriate documentation and such for them.

Also, did you install this Chrome instance yourself, or did someone else do it? If someone else, are you sure they didn't install a proxy bypass tool or configure it to tell the proxy to let it pass? On the systems for my old company (Nokia) we had to configure it to allow the proxy to allow us to bypass the firewall - necessary for developers who were writing web browser tools...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Windows usually uses the entire disc, so even if you think your Windows system uses only 75GB of the disc, that is likely only the amount currently in use. Also, current Windows systems use the EFI boot format, and depending upon your SUSE version, it may be looking at the boot partition as a pre-EFI standard boot partition.

Myself, I would suggest using a virtual machine manager such as VirtualBox on your Windows host, and installing OpenSUSE in a virtual machine with that, eliminating this problem altogether. The only issues you would have with that is if you need to develop hardware drivers for SUSE, in which case I would recommend that you install OpenSUSE on an external drive and boot that when necessary. Dual boot systems, especially these days, is often much more trouble than they are worth.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Reading the gcc man page is also a good idea. It's really long, but all the options are covered pretty well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are the logs from a Linux system? What kind of data do they contain (you just need to provide a general description of what they are)? Are they consistently formatted (at least by type)?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It would seem that way to me. Software engineering encompasses a lot of computer science principles, but not necessarily the other way around. It's like the difference between a mathemetician and an electrical engineer. The engineer needs a good grounding in math, but the mathemetician may know nothing about electrical engineering.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like a unit test method that can be called by unit tests. If it cannot find the interface for database scripting, it will throw an exception, otherwise it will do something (not yet defined). In any case, the code is not what I'd call "professional quality" in that instead of an else {} it uses a test for not-null, after it already did a test for null of the interface object - extra unneeded code, and more prone to error.

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

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

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

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

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
  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

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

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

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

There a built-in open source nVidia driver for Linux called Nouveau. nVidia also has proprietary Linux drivers for their gear which work very, very well. The proprietary drivers are much more efficient than the Nouveau driver. I run Nouveau on my laptop which has an nVidia GPU, and the proprietary driver on my workstation which has an 8800GT video card. I use the proprietary driver on that system because I run multiple HD displays and do quite a bit of video processing so it needs the best drivers available, which happen to be the nVidia proprietary ones.

FWIW, nVidia also has Linux SDKs for using the graphics cores for serious parallel number crunching.

Also, since nVidia is working with the Nouveau team at providing better support for their cards in the open source universe, Linus has withdrawn his extended middle finger from pointing at nVidia... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, what language are you using? Next, why isn't this in the Software Development forum?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Still an early C++ learner?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume this is a shell script. When you execute the argument as a command, it has to be found in the system's PATH environment. Try ./$1 instead. That tells the shell to look for the command (argument) in the local directory, where you executed the ss4 command.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try system("java -jar ./myJar.jar"); assuming that the file is in the same directory as you started your C++ application and it did not change directories before it executed the system() call.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Then try a new battery or take it in for repair. How old is it?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you plugging into a wall charger, or is it plugged into a computer USB port? As JorgeM suggested, try an alternate charger. So, if you don't have another wall charger, try a USB connection to a live computer. If it still doesn't get beyond 10%, then it is most likely a bad battery, or a bad charging circuit in the phone.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It depends upon the drive. Some manufacturers' drives run hotter than others. On my system, my 2TB WD green drives run about 10C cooler than my 320GB Seagate system drive. They are all healthy, at least according to the SMART interface data that I monitor. That said, I have had Seagate 500GB-2TB drives that ran too hot and failed sooner than they should have. Fortunately, most were under warranty, so I only had to pay for shipping in a couple of cases. The replacements are still running hot, so I have decided to use 7200rpm WD drives for now. They have been much more reliable, have fewer bad sectors, and don't overheat.

As for noises when you copy files, that is probably the head positioning drivers. They do make noise to some extent - which is why I usually stream some music when I am running my system (like right now)... :-)

FWIW, Hitachi has a good reputation, and as a disclaimer, I used to consult with Seagate. I still prefer Western Digital drives.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Translation - "Who speaks latin?". :-) My sister and I would speak pig latin around our parents when we were kids and didn't want them to understand us. This was back in the 1950's - hence my comment "It's been awhile." :lol:

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Huyay eakspay atinlay? It's been awhile... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your most obvious issue is this: else if (command == 2);

Since you dont do anything is this branch, you need to remove the trailing semi-colon. Also, since this branch does nothing, why not just remove or comment it out?

Final comment. ALWAYS bracket all conditional statements (branches). It eliminates a lot of problems like this. IE:

 while (active)
 {
    cout << "\n> "; cin >> command;
    if (command == 1)
    {
        add(items); //here is the problem !
    }
    else if (command == 2)  // remove();
    {
        // nothing to do here is obvious.
    }
    else if (command == 3)
    {
        display(items);
    }
    else if (command == 4)
    {
        active = false;
    }
    else
    {
        cout << "bad command...try again";
    }
 }

As for the fact that add(items) is your problem, in that function you do no error testing. In my experience, error testing should be about 50% of your code for reliable system software.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Install Eclipse with the CDA (C/C++) plugins (probably there by default now). Configure it to use your MinGW GNU compiler. That should work just fine. Eclipse is an IDE for Java, C, C++, and many other languages which will work on Windows, Unix, Linux, and other systems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try printf("%lu %lu\n", msizeof(x), sizeof(x));
Note that sizeof(x) returns a size_t value, which is a long integer, hence the error/warning.

Also, do note that it is Sunday morning here in the west. Don't expect answers immediately - most of us are probably still in bed!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried single-stepping through the code in your debugger? If you don't know how to use a debugger, it is time to learn! We could analyze your code for you, but it is "better to teach one how to fish, than just give them a fish"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
Wh == Watt Hours
Watts == volts * amps
Ah == Amp Hours
Watt Hours == Amp Hours * volts

So, 1200mAh == 1.2Ah which  * 3.7V == 4.44Wh
    950mAh == .95Ah which * 3.7V == 3.51Wh

This is just about what the specs say. They are just rounding down to the nearest decimal place.

So, no. It will not damage your gear. The key is the volts provided. The Amp Hours / Watt Hours is the capacity of the battery. Since they provide the same voltage, the 1200mAh battery will, as seen, provide more capacity to run without charging.

cambalinho commented: thanks for all +3
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Too much irrelevant code. The timeout code was clear. Please just post the timein code. It should be very much the same as timeout, just with in-time instead of out-time.

Also, PHP is an object-oriented language, very similar to C++. DO NOT mix PHP and HTML/JS. Build up your HTML and JavaScript code strings in your PHP classes as string values, and then output the strings when needed. This provides a couple of major advantages to the mixed domain you are using:

  1. It is easier to debug.
  2. You don't get unintended side-effects.
  3. Changing environment issues are much better dealt with - you can change the strings before they are output.