rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, can you use standard template library collection classes, such as std::vector<T>? Or do you need to support your own collection classes/functions/methods?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Speak with your advisor if you can't come up with a suitable subject on your own. Part of the educational process is learning how to explore the domain you are interested in, and choosing a thesis project is part of that. This is not the place to ask this question as the subject matter is pretty much limitless.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please show your code. Just telling us that you have a problem is not very helpful.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Like declaring global variables as extern, you can do that with functions as well. Here is an example from a header file in my current work project:

extern int setup_notify_events();

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I agree with mattster. A good start on a Linux blog.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just stating the problem is not enough to help you. Please post your code and algorithms that you are using for the collision detection.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Linux automatically reserves about 10% of available space for root, so when users fill up the file system(s), the admin can still get things re-arranged (backups, remove old/stale files, etc).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what precisely is your problem?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good link. As noted, Apple really wants to lock you into Objective-C instead of a real standards-based language like C++. The paradigms are similar (object-oriented programming), but the syntax and implementation are different. IE, you can't just take your Objective-C applications and migrate them to another system, without a suitable compiler. Fortunately, there are Objective-C compilers for Linux and (possibly) Windows, such as Clang. How well they support the Cocoa API's is an entirely different question, however! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is likely that either your code is malformed, or that security protections prevent this from executing. IE, the string is in "string" space, but you are trying to exectute as though it is in executable code/text space. I'm not sure what you would need to do in that case. Is this for security research? Have you studied the appropriate processor and operating system documentation on how to do this? Have you tried changing the typing of your code[] array to const char* code = ...;?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If the connection is physically secure and this problem occurs with more than one drive, then you have to assume there is some problem on the system board - a bad connector, controller, or whatever. In such a case, just replacing components is not likely going to fix the problem. You may need a new system board.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Makhetha, please don't hijack another's thread. Please start your own and we will attempt to answer your question. That said, please provide more information, such as system to connect with, the device you are trying to connect, the operating system you are using, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Several problems.

  1. In struct reco, the money field is an int, not a float.
  2. You need to return an int from main() - at least for current compilers and systems.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And FWIW, I have written numerous date processing functions over the years, in language ranging from BASIC to dBase II to C++ and Java date/time classes. They all properly dealt with leap years/seconds, days of week, etc. So, first convert the date to a Julian value. Then, the rest is simple math.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not wanting to go through all this code, I have one suggestion - use julian date values. There are standard expressions to take a julian date (either unsigned integer for y/m/d, or double float for y/m/d/h:m:s) and extract the day of the week, accomodating leap years, and even leap-seconds (if necessary).

Also this:

    if(day==911){
        cout << "The Program has Ended" << endl;
    }

should be this:

    if(day==911){
        cout << "The Program has Ended" << endl;
        return 0;
    }
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you installed the Urdu language pack for the OS, as well as (if necessary) .net? It (they) will also have to be installed on the shop's machine(s).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I have used cygwin for many years and never had a problem installing gcc with it (multiple versions of gcc in one cygwin instance, just like my linux systems). Have you tried uninstalling, and reinstalling cygwin, and when you have the package page showing as to which packages to install, did you enable gcc then, or did you try it after cygwin was installed?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

While Linux is not Unix, it is a Posix-compliant operating system, so most of what you learn about Unix is relevant. I have used both Unix and Linux (and related systems such as QNX) for many years. This is a good book - probably worth getting for general background information and knowledge. Kernighan was one of the original Unix developers at Bell Labs, and he was, with Dennis Ritchie, the author of the C language, still at the heart of most operating system development, especially Linux.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The file /etc/resolv.conf (no trailing 'e') is controlled by your network dns settings. If you change it manually, the changes will only be in effect until the next update or reboot, unless you change your network settings to block that. Sorry, but I don't remember right now what settings need to be changed, but I know I have done that some time in the deep, dark past.... :-) Remember, Google is your friend!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Since this is in the subject "Shell Programming", I have to assume you are running some varient of Linux, and most likely the bash shell? Linux supports just about any character in a file name, including question marks. If an application wants to create a file with such a name, then it can (usually). The problem starts when trying to scan for these files in a bash script since question marks are wild card characters in bash. To match a real question mark, you have to "escape" them - preceed the question mark character with a backslash. The suggestion by rch1231 is not a bad idea. The rm command will ask you if you want to delete each file in that directory. The only problem is when there are a lot of files with those names. Given that Linux directories can easily contain hundreds, or even thousands of files, that could be quite tedious! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try downloading the package deb files directly from debian: http://packages.debian.org/squeeze/nasm and then use apt-get or dpkg to install them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is also a Win7 and XP tool that can restore the Windows MBR. The actual problems is that the Grub boot loader is looking for the grub configuration files in the Linux partition, which don't exist any more. So, if you boot directly to the Windows recovery partition, or from a Windows recovery disc, you can restore the MBR and Win7 will go back to booting properly.

Mike2k's suggestion about using EasyBCD is also a good one - you can boot it from CD/DVD/USB and restore the Windows MBR from that. Here is a link with instructions and helpful screen shots for that tool: http://www.linuxbsdos.com/2012/03/10/restore-the-windows-bootloader-to-mbr-after-dual-booting-with-linux/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. I missed your call to listen() in the code example. You are basically doing it ok, but you may want to increase your queue length (2nd arg to listen()) to some number bigger than one if you may be getting multiple connection requests at the same time.

Also, looking further at your code, this line:

while(buf !="exit")

Won't work. You need to do this instead:

while(strcmp(buf, "exit") != 0)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Oops. You listen() first (sets up the incoming queue length), and then you loop, calling accept() to get connection requests from clients. Sorry, my answer was backwards in the previous posting... my bad! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, for a server, you don't need to bind the socket, but you need to do an accept() before you listen() for connection requests. A client will bind().

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming that they both use the same video adapter type, such as DVI or vga, and your video adapter supports two of those types of displays, then you should be "golden". I use two slightly different monitors on my desktop (24", 1920x1200, DVI w/ nVidia 8800GT adapter), and except that the colors are just a little different (adjustment gets them close, but not exactly the same - a typical issue actually, even if the displays are "identical"), they work great!

That said, if your adapter supports 2 monitors, but one is DVI and the other is VGA, then as long as the monitors each support one of each, then that should work also. DVI is preferable to VGA from a performance and usability perspective.

aVar++ commented: Ok, that helped alot thank you. +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your CPU, HD, and video card are likely the biggest current draws on your PSU. See what the load is (you can find out from the manufacturer's documentation). FWIW, if you are only running one of the DVD drives at once, then you will not likely have a problem. Running both may be an issue, if you were to use one to copy to the other, for example.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

NP Mike. I've run into the "massively concatenated environment variable" issue before, even to the point of exceeding the maximum length of an environment variable. That's how I know about the problem! :-) You know that old saw - "It hurts when I do that!" - resp. "Then don't do that!"...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually Mike, you don't want to set PATH in .bashrc, as it is executed on each invocation of bash, sometimes resulting in PATH variables like "/sbin:/sbin:/sbin:/usr/bin:...". Path should only be set (in my opinion) in .bash_profile, or in a manually run script when you need to temporarily add a new link to PATH.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sometimes you have to do this the hard way:

  1. Remove all binaries and directories for the "tool".
  2. Remove all registry entries for it.
  3. Reboot, and see if it re-installs itself.

If in #3 it re-installs itself, then you have more work to do. This may not be simple, and certainly a terrible waste of your time, but necessary.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You should be able to modify the tmpfs entry in /etc/fstab to add the option size=NN where NN is something like 20M, etc. Here is a link to a good article on the subject: http://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/

Note that tmpfs uses the swap file for storage, so make sure your swap space is big enough for your needs.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you mean by "modify tmpfs? Where it is mounted? Please explain exactly what you are trying to accomplish.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Correct! You can declare a common namespace in many source files / headers. The effect is cumulative in that in each case, the contained classes/symbols are added to that namespace.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You say it won't start, but the reset button will force it to boot. Have you set your BIOS to output detailed POST (Power On Self Test) information when it boots? If you do that, you should be able to see where it gets to in the boot process before hanging.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is probably a problem with the web site. Have you tried other browers, and if so, does the problem persist?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

if ((courses < 4) && (courses > 6)) is wrong. You want to verify if the courses variable is between 4 and 6, inclusive, so it should be if ((courses < 4) || (courses > 6)). IE, use the OR, not the AND boolean operator.

ddanbe commented: Good observation +14
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please show more code. Your error indicates that you are missing some virtual function declarations. The vtable is the virtual function table. Since you aren't showing the derivation of your classes, it is difficult to help further.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Dec - per your signature - water, water, everywhere! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is a laptop? Many laptop WiFi devices are USB connected, even when they are internal. My Dell D630 Wifi card is usb, but internally connected.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I seem to be agreeing with deceptikon a lot lately! :-) That said, strtok() is not the be-all and end-all of string parsing. I tried it a long time ago when writing an object serializer/de-serializer and found out its limitations, ending up writing my own tokenizer that could handle such things as nested quotes, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

2-dimension sort

  1. for each member of first element, sort second.
  2. sort each member of first element, and maintain order of second.

Enjoy!

And BTW, you have your rows (first element) and columns (second element) reversed! Your 3x4 array should be 3 rows of 4 columns, not the other way around... Think of it as a 2 dimensional array of x and y, where x is the row, and y is the column. You CAN do it the other way around, but it gets messier when you go beyond 2 dimensions and add a z (3rd) dimension... :-)

Getting back to the math - in reality it really doesn't matter, but your matrix[rowindex][colindex] is reversed from what you think it should be. Eyes crossing yet?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Class members are part of a class instance. Where they live depends upon where the instance lives. If you declare an instance of a class as an automatic variable, then it is on the stack. If you allocate it with operator new, then it is on the heap. See example:

void sumFunction()
{
    SomeClass anInstance;   // On the stack
    SomeClass* pToAnInstance = new SomeClass;   // On the heap
    .
    .
    .
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And just an FYI, I wrote a library to handle arbitrarily large numerical data back on the 8086 in the mid-1980's, so I know what is involved with doing that! :-) I also had the 8087 math co-processor, and it could handle internally up to 80 bits of precision. I used that up to its limits, and then switched to software. Of course, one can use clever algorithms to maximize the use of the math hardware on modern systems, but I didn't have the time, and inclination, to do so at that time. It was just an experiment when I was developing serious prime factorization algorithms in relation to public key encryption that had just been published by RSA (Rivest, Shamir, and Adelman).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As AD said. On most modern systems, if you are running a 32-bit OS, a long int is 32-bits, and a long long int is 64. On 64-bit systems, mostly (not sure about Windoze - I run Linux) a long and long long both are 64-bits. You can tell by evaluating the LONG_MAX and LLONG_MAX macros.

So, if you want to evaluate REALLY large powers of 2, then you will need a specialized numerical library that can handle arbitrarily large numbers. I think that the boost library will do that for you. Do bear in mind, however, that these are slower than native libraries which will use the CPU's math hardware. They have to do the computations in software, at least after some point, and that is WAAAAY slower than hardware! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What text book(s) are you using? There are some good ones out there that deal with this stuff. Generally, you tokenize the code, and then create a set of tree structures or finite-state-machine to represent the program. As you might infer from this, there is more than one approach that can work for you.

Two books that I have used in the past are Allen Holub's "Compiler Design in C", and Fischer/LeBlanc's "Crafting a Compiler". Both are on my shelf. FWIW, between the two of them, they take up almost 4 inches of shelf space... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is as I said - you need a separate array of exam grades associated with each student. You have only one exam array, so it will ONLY contain the last set of data that you read into it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show all of your code, including variable definitions. This is not sufficient to tell you why your grades are not in the proper order. However, you have only one exam[] array, and you need one for each student, which is why each student has the same grades...

Create a Student class that contains an array of exam grades, and then create an array of students. The pseudo-code for this would be:

for each student
    read student id
    for each exam
        read student exam grade
    endfor
endfor
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To quote someone, it all depends! Some UPS systems are inherently good surge suppressors. Others are not. In any case, do remember that surge suppressors (power strips with surge protection usually) use a device called a MOV Varistor - they have a limited lifespan. After so much time (# and significance of surges), they degrade to uselessness. This is your normal consumer device. Replace them once a year. There are other technologies that don't degrade over time, but they are more expensive (thyristors, etc). My guess is that your consultant's PDU is more likely a thyristor type of device, hence more reliable. Ask him to explain! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to run yum as root, or with sudo (assuming you have sudo privileges). Since you are using yum, I assume you are either running a Red Hat or SuSe distribution? The openssl package is a standard module in the "security" distribution. FWIW, WHY do you want to remove openssl? It is a dependency for many other packages, so removing it could seriously impact your system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Less than a day? :-) Ok. I've been doing serious software engineering for 30+ years and am still learning about this subject (and others). Let's start with what you DO know, and then move to what you NEED to know!