rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For simple C++ executables, you can just use the make command directly. So, if you want to build a simple C++ source file named my_application.cpp, you can just execute the command: make my_application
That will compile and link the executable for you quite nicely. A Makefile is unnecessary unless you have more than one source file to link.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A lot of usb memory sticks come with some sort of encryption tools installed on them. Myself, I just reformat the entire device because most of that cruft is worthless. If you need to encrypt your data on the device, there are good full-disc encryption tools out there, including open source ones.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have allocated the array of poitners rowptr, but not the elements of each row. As a result, your strcpy() functions will be corrupting memory. You also need to do this:

 for (row = 0; row < nrows; row++)
 {
       rowptr[row] = (char*)calloc(ncols, sizeof(char));
 }

As mentioned, you also need to change the type of rowptr to a char** instead of an int**, and change the allocateion to rowptr = (char**)malloc(nrows*sizeof(char*)); or rowptr = (char**)calloc(nrows, sizeof(char*));

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My guess is that these are "filler" tracks, containing nothing, but there as separators for the actual music. Unfortunately, without access to the system(s) in question, that is just a guess... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These are linker, not compiler errors. Do you have the libf2c package installed on your system? Also, why use f2c instead of gfortran?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming you just want an internal network address, you need to go into the dhcp setup page on the local router and see what the dhcp address range is. Then you go into the network manager application on ubuntu and set the network interface to use a static address that is outside of that range. You will also have to set the netmask, dns, and gateway addresses, so before you do that, run the ifconfig command to see what those values are for the dhcp address you have now.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Consider Linux samba shares just like Windows shares. If you don't have AD (Active Directory - or OpenLDAP, the Linux equivalent to AD) installed on your system, then you need to have a userid/password for each authenticated user who can access your Samba shares, on each Linux system you want to allow them access to. This is why a single-sign-on method, such as AD or OpenLDAP, is so useful.

So, I think you have some more studying to do, and a recommendation? Install a Linux virtual machine (or 2 or 3) on your Windows PC and experiment with these tools.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are on your way to c++ coding mastery. As for keyboard input, look at some of the massively available open source code available. In the open source universe, there is no such thing as stealing (unless you don't give credit where credit is due!)... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good suggestion Mike! I'd just make one alteration in your showMessageDialog() text, to

      JOptionPane.showMessageDialog(null, "Not good at following instructions?" +
                                            "\nI said enter a number between 1 and 10 bonehead!");

:-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your setBaseSalary() function should be tagged as throwing an exception. IE:

 public void setBaseSalary( double salary ) throws IllegalArgumentException
 {
        // TODO: implement this method
        baseSalary = ( salary < 0.0 ) ? 0.0 : salary;
        if (baseSalary < 0.0)
        {
            throw new IllegalArgumentException("Negative base-salary values should be rejected by setBaseSalary and result in an IllegalArgumentException");
        }
 }

Not specifying that the method throws an exception is an error, and should have been trapped by the compiler.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have an explicit return before the end of the loop, so there is no looping going on. All of what VernonDozier said goes double for me.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Several things. This function (which should be a const function as in Element operator+(const Element&obj) const;) adds one Element to another. That isn't what you are doing. It may work if you have an Element constructor that takes a single integer argument, but in your case, you should create an Element operator+(int) const method, and then reverse the order of arguments in your output stream to cout << (b+5) << endl;

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Install Linux in a virtual machine that uses bridged networking (so the VM gets a fresh DHCP address from the family router). Then, use that for web surfing. That should completely bypass the Windows filtering tools. Also, have you tried browsers other than IE, such as Firefox, Chrome, or Opera?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You will if you set the explorer file options appropriately. I have mine set to run each open explorer window in a separate process. That is not the default - it is as you say. However, that can be overridden easily enough, and trust me when I say that I can have a number of explorer.exe processes running - 1 for each open explorer window.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can also configure your system so that each open explorer window is a separate process (I do that, for security and performance needs). It requires more memory, but is more stable, in my opinion. At least if something causes one instance to crash, all of the others are unaffected. This can keep the system running in unusual circumstances.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In this code

        for(int j = 0; j <= st.countTokens(); j++)
        {
            basics[j] = st.nextToken();
        }

try this instead

        for(int i = 0, j = st.countTokens(); i < j; i++)
        {
            basics[i] = st.nextToken();
        }

also as James said, check if basics[i] is null when you are accessing it later on in your code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You don't indicate where in your code you are calling into tidtable.c, so we really can't help you much. A couple of observations however. 1. Make sure that all pointer variables are initialized (at least to null) when you declare them. 2. You don't validate the pointers that are passed into your function. If they are null or invalid because they weren't properly initialized, then you are toast.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The top line of "last reboot" will show the last time you rebooted. The bottom line "wtmp" is not the last reboot time. Also, the "uptime" command will show how many dates+hours+minutes the system has been up since last reboot. If you add that to the top line of "last reboot", you should come up with the current date+time.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try reading the man page for grep/egrep: man grep

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are freely available tools like wikis to do this. There are versions you can host yourself, or ones that are available on the net, such as www.wikispaces.com. Try a Google search for wiki software. One link is this one, comparing a number of wiki software packages on wikipedia: http://en.wikipedia.org/wiki/Comparison_of_wiki_software

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In this case, you already know the number of elements (min(100,sno1)) and size of each element (20). Use those values instead of the computed values, besides the fact that the size argument is not the size of a char*, but is 20. So, your qsort call should be this:

qsort(&list[0][0], sno1, 20, compare);

Also, your while function should read like this - skipping the copy part:

while((fscanf(data,"%s",&list[sno1][0]))==1)
{
    ++sno1;
}
el33t commented: Thanks! This solved my problem! +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, there are a number of good online dictionaries on the internet. Here are several for English:

  1. http://dictionary.reference.com/
  2. http://www.merriam-webster.com/
  3. http://oxforddictionaries.com/
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, I assume this is a compiler warning. Post the rest of your code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The actual ethernet frame size is 84-1542 octets (bytes) in size. Here is a wikipedia article about it: http://en.wikipedia.org/wiki/Ethernet_frame

The last 12 bytes is taken up with the interframe gap, so the actual data packet, including the CRC is 1530 bytes in length.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your file system has been corrupted due to the hard shutdown. You need to boot with a recovery disc or partition and fix the file system before you can continue.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What distribution+version of linux, and which version of wpa_supplicant are you using? FWIW, this is a pretty new enhancement, so you may need to get current sources and build it from scratch.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, a more generic offering:

void swapChars( char* p1, char* p2)
{
    char tmp;
    tmp = *p1;
    *p1 = *p2;
    *p2 = tmp;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Swap elements 1 and 3:

void swap1and3(void)
{
    char* p1 = &menu[1];
    char* p2 = &menu[3];
    char tmp;

    tmp = *p1;
    *p1 = *p2;
    *p2 = tmp;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Start by studying other kernels - simple ones like FreeDOS, for which the source code is available. You need a kernel (control program), and a shell (monitor), along with some utilities to do something like look at system activity, etc. There will be drivers necessary in order to access any hardware (video, drives, etc). So, you might want to get an appropriate operating system book, such as Minix (which was Linus Torvald's inspiration for Linux). Look on Amazon.com.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most of your code is pretty bogus... :-(

  1. The structure member ar[] has the size outside of the brackets. Wrong...
  2. The rest of your code is bogus. The initialization of buff is not correct.
  3. What is this while() condition? And what are the minus signs preceeing the array[i] members of the loop?
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And FWIW, using a zero size array as the last element in a structure is not an uncommon (but deprecated and discouraged practice) for a variable size element who's size you don't know until the structure is created. In such a case, there is usually a member of the structure that stores the size of the array, as in:

struct foo
{
    size_t sizeOfArray;
    char array[0];
}

struct foo* makeFoo(size_t size)
{
    struct foo* retval = calloc(1, sizeof(struct foo) + size);
    retval->sizeOfArray = size;
    return retval;
}

These days you would use a size of 1 for the array as some compilers don't like 0 size arrays. Remember, just because GCC and/or MS Visual C/C++ let you do so, doesn't mean that other compilers will. Trust me that this exact thing has bitten me in the backside in the past... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes, in theory you can have a zero-size array, but you cannot do anything with it except get its address! And, even though conformant compilers will deal with it, it may actually have no address since it uses no space! My guess is that the compiler simply eliminates it as unneeded code/data. However, you are taking its address in your printf() functions, so I guess in this case, it does give you an address. However, I think that the address of a and b (both on the stack) will be the same... Anyway, this begs the question - why are you doing this?! :rolleyes:

zeroliken commented: completely agree +9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It may be a clock syncronization problem. Make sure all your systems are getting clock updates using NTP. You can either use an internet NTP server such as NIST, etc, or you can set up a local server on your LAN which will keep all the PC's updated locally, yet it will keep updated from the Internet - allowing a large LAN installation to minimize the amount of NTP traffic going out of the firewalls.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You could always install a Linux operating system on your laptop... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Back in the day when Ethernet was over coax cables, half-duplex was a necessity (the comment about CSMA-CD is appropriate here). That changed with ethernet over twisted pair when you could have separate channels for sending/receiving data. Back then, before ethernet could run over twisted pair, ethernet was not suitable for real-time control systems. Arcnet and Token Ring could be (and were) used for deterministic realtime systems. Once ethernet was running on full-duplex switched gear, it became capable of real time (deterministic) behavior, so now it is ubiquitous in industrial control systems which previously would have been interconnected via alternative means.

silvercats commented: thanks,good info +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A VPN is the usual way, although if your bandwidth needs are great, you might be better off leasing dedicated bandwidth on the fiber optic cables between point A and B. My company (a tier-one mobile phone manufacturer) has data centers in a number of places all over the world. We have that sort of dedicated "pipe" between our various data centers so we can easily shift load from one to another as necessary. Our major data centers are in the US, Great Britain, Singapore, and China, and more regional ones in India, South America, and elsewhere (not sure where they all are). These are multi-gigabit links. So, depending upon the day and time, a phone user in Brazil that wants to browse their Facebook account may be connected to a data center in any of those locations. To the user, there is a small delta in latency, but overall the end-to-end time is very close to the same.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most A/V products perform what is called "on access scanning" in that when you start a new program, then the A/V product will scan the program file and all loaded components (shared libraries, and other files) before allowing it to run. This can cause serious performance problems, as you have seen. Once they are scanned and loaded into memory to run, then the system load will return to normal. Let's say that the executable and its associated libraries and other data comprise 100MB, then the scanner has to read through and analyze all 100MB EACH AND EVERY TIME it is loaded into memory. Myself, I usually disable that "feature" since I scan stuff before I download or install it on my computer. I use ClamWin, an open source A/V program. It does not do on-access scanning, though it can scan memory as well as files on demand, and it can be integrated with your email and browsers to keep malware from getting into your system in the first place.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. I think your logic for push() and pop() is somewhat inverted. In push(), you set the top of the stack to the new element (S(top) = item), and then you set top to the previous entry (top = top + 1). Why line 11 in main() is generating the error (push(s, 5), I am not sure. Let me think on all of this some more, and review my old ADA texts... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Whew! I haven't coded any ADA for about 7 years, so it will take me a bit of refresher time to help you on this. Be patient! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

See Knuth, Volume 3, Sorting and Searching, Addison-Wesley Pub.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It would depend upon the GPS device that you have. Some may support installation of a SIM, others a USB cellular modem, and others perhaps neither. In any case, if your GPS device does not support some variety of external communication service, you are SOL.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

See the C function getopt(). Alternatively, iterate over the argv[] array passed on the command line to main(int argc, const char* argv[]). If you don't know about this stuff, you have some studying to do before you try to solve this assignment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The original INT 13h was for a real-mode system. Once the operating system has booted into the OS these days, unless you are running MS-DOS/FreeDOS, et al, you will be running in protected mode. You need to check your OS documentation to see if INT 13h will still work for you. You set up some registers for the sector to read, and possibly the address to read the disc into (normally that would be fixed in a real-mode boot loader), execute the interrupt, and there you are. FWIW, the last time I wrote a bootloader (real mode) was in 1986 or 1987. I'd have to pull out my old IBM PC BIOS docs to see what needs to be done for sure...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How you do it depends upon whether you just need serial input/output, or if you need some random access to the data. If you need random access to the data, then as Ancient Dragon said, you need support for files >4GB (maximum a 32-bit offset can handle. Current Linux systems support access to very large files, for both 32-bit and 64-bit systems by defining the type fpos_t appropriately.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It depends upon the operating system that this device is running. If it is running OpenWrt, then this may help: http://wiki.openwrt.org/doc/recipes/3gdongle?s[]=3g&s[]=usb&s[]=dongle

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You pointed the pointer (sic) to an external variable, which won't go out of scope until the translation unit (source file) terminates. The variable itself will terminate when the function is finished, but the external variable glb1 will retain the value you set inside the call fnCall2().

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but I need to know what your price range is in US Dollars. The Galaxy S is a great phone. I have been using a Google (HTC) Nexus One for about 2 years now (Android 2.3 - Gingerbread) - and it has been very reliable for me. I think the Galaxy S is running ICS (Ice Cream Sandwich), which is the latest (possibly greatest) Android version available. In any case, I don't think you will be unhappy with that purchase.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, the compiler should have complained that you were assigning a string constant to a non-const pointer (char* guidStr). The initialization should have been like this: char guidStr[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0','0','}',0};

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, then you may need to go into services and stop/disable the servers that are causing this problem before you can reinstall postgresql.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think postgresql on Windows is one of those things where you have to reboot the computer after you uninstall it so it can deal with the background services it starts.