rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you contacted Nokia support? Does your data plan support tethering? Is the phone configured for tethering? FWIW, I am a senior systems engineer at Nokia - I have to ask these questions! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What happens when you use the battery, but not the external power supply? Does it do the same thing? Your post wasn't explicit about that. If it does, then there is some material problem with the system. I presume from your post that it is out of warranty. If so, then go to the HP support web site and see what they will charge to repair it. Usually that is a flat fee. If it is too much (after all, they will prefer to sell you a new computer), then look for alternatives. I have an independent computer store in my area that refurbishes computers and laptops, and sells them for really good prices, with warranty. There may be someone like that in your area. They also do repairs. Many times, such problems are something as simple as bad capacitors on the motherboard, which a competent repair depot can handle - even my grandson can do that (he is a really good electronics wizard, since he was about 8 years old).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Power it down and let it cool. What thrillride01 asked is relevant here. Does the CPU have a cooling fan or heatsink attached?

Let me just say, that I have built a lot of systems myself in the past, but even as a professional in this field, when I need a new custom workstation, I pay my local whitebox vendor to build one to my exact specs. He warranty's it, and his business is focussed on doing just that really well. My current system (a dual quad-core monster) he built 5 years ago, and it is still working like a clock, although one of the drives just decided to fail. However, it had a power-on time of 4.8 years, and it is far out of the 3 year warranty for the drive, so I can't blame him! :-)

FWIW, this system is on 24x365 unless I am on vacation for more than a couple of days, when I power it down completely. I once went on a trip, and one of my external disc arrays decided that the fan was going to fail, cooking the drives... :-( They were quite new, and I got the raid array from the same vendor as the drives, so after a bit of complaining, they replaced all of them with new gear. Unfortunately, the data wasn't so easily recoverable.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As all before said. Easiest, add two more 1GB simms to the remaining slots. That will max out the system if you are running a 32-bit OS. If your CPU and hardware can handle 64-bit systems, and you install one, then you might be able to install 4x2GB or bigger simms. Again, as said, check with the vendor. My system will handle 8x4GB simms, but I only have 4x2GB ones installed since more cause serious overheating. I may upgrade to 4x4GB to double my available memory, but so far 8GB total ram works well for my 64-bit operating system. I am normally only using 1-3GB of RAM. When it goes over that, it is usually because some bit of software has decided to break down and suck up all the system memory... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Wales - the location of the filming and production of the new Doctor Who, Merlin, and a bunch of other great TV shows! Hope to get there some day... :-)

P.S. My housemaster at Dulwich College in London where I spent a year (4th form) was from Wales, Mr. B.M.Jones! And for all of us ignorant Yanks, Jones IS a fine, respected Welsh name... So, if you are a Jones, then someone in your past was from that rocky shore!

P.P.S. I am partly a Roark, so my family hails from the Emerald Isle. In fact, one of my distant cousins was Mary Shelley, so I guess you could say that I am the cousin of Frankenstein... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For now I just want to remove Linux and install windows. May try dual boot when more knowledgable. How do I do a clean installation instead of an upgrade? Thx

As I said above, don't use the upgrade option. Use the clean install option. However, if your Windows disc is an upgrade disc, you may be SOL and need to purchase a full installation media... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You posted this in the C language forum, yet you are using C++ constructs. Is this supposed to be in C, or in C++? Or does it not matter?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Typically, postfix is implemented as you did, with a stack-based approach. There are alternatives. It sounds like your professor is trying you to implement this in a recursive algorithm.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not an upgrade. This is a clean installation. You don't upgrade Linux to Windows. If you have enough disc space, you can perform a dual-boot installation (install Windows first, and then Linux). Windows usually doesn't like to co-exist with Linux unless to tell it specifically to NOT use the entire disc.

So, do you want to remove entirely Linux and install Windows? Simple enough, just do a clean Windows installation (not an upgrade). It will happily blow Linux away and take over the disc. Then, if you really want to play with and learn Linux, you can install something like Virtualbox and run Linux in a virtual machine running as a guest OS under Windows.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try the command "uname -r" - if you have a 64bit system, there should be an x86_64 in the kernel name string that will print. Ditto, look at the files in /boot. There are a number of other methods as well, but this will work. This will tell you if the OS is 32 or 64 bit, but it WON'T tell you if the hardware is 64-bit capable if it is running in 32-bit mode.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How many pixels per row and column in the total image are there? Also, how many pixels per cm are there? Your problem is how to locate the offsets in the buffer where the images exist, and then look at the pixels in those ranges. There are a number of techniques to do that, but writing up the pseudo-code to model what you need to do will help. Example (not complete, and may not be correct):

get buffer size in bytes
get pixel size in bytes (32bits == 4bytes)
calculate number of pixel rows and columns in reference object
calculate number of pixel rows and columns in leaf object
get number of pixel-sized rows in image
get number of pixel-sized columns in image
get location of reference object (row,column) top left corner
get location of leaf object (row,column) top left corner
for each row in reference object
    skip to start of row in buffer
    for each pixel in row
        if pixel is black, save pixel location
    endfor
endfor
for each row in leaf object
    // see reference object loop above
endfor

Consider the displaying part to be an exercise.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have a couple of problems. Mostly the variables that you pass to the cpu() and memory functions are being used as though they are being updated inside the functions, yet you don't update them there. Also, if that was your intention, then you need to alter the signature of these functions to this:

int memory(int adress&,int& data);
int cpu(int& number, int& data);

so you are passing the values by reference, then when you do this:

memory(x,y); 
write(pipefd[1],&x,5);

The value of x will be properly set and passed to the write() function.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First of all, this is VERY old K&R style code. Most modern compilers will emit a lot of warnings and possibly errors unless your compiler has a flag that will tell it that this is old code. Second, deceptikon is correct. Asking people to comment an 800+ line source file is unfair. It also deprives you of analyzing the code and understanding what it does. Just keep going through the code, line by line, and as you understand what it is doing better, add your own comments. That is how you learn. Code analysis is something that all software engineers and programmers have to do, otherwise there is no way they can modify someone else's code to fix bugs, add features, or write something similar but different.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Often, the fibonacci sequence is computed using a recursive function as shown in your comments (except for 0 and 1), and fib(6) == 8, not 5. I think the teacher wants you to learn how to write a recursive function instead of plugging in a formula that you looked up on the web. The function signature would be something like this: unsigned long fib(unsigned long n);

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Isn't that why you are taking the class? We don't do your homework for you, but we will help you solve problems once you have made an effort to do it yourself.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Usuallly (if you can), you boot into the BIOS and set the boot order to boot from USB first in your situation, If you cannot do that (via configuration), then you need to press (usually) F12 and select the boot device (USB). Otherwise, it will try to continue to boot from the internal HD. This is why I previously suggested you get a new HD to replace the old (bad) one. Then, boot from a USB/CD/DVD drive and install Linux from there. This has worked well for me many times in the past.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is an excellent excercize! You will learn how to code C structures, and generate XML data. Start by describing the solution to the problem in text/pseudo-code. Think about the structures you need to reflect the data (classes in C++), and what XML contructs will reflect that data to write to disc. Make an effort, and we will be happy to help you sort out your issues, but AHarrisGsy is absolutely correct in that we are NOT here to help you cheat! I'm SURE that is not what you intended, correct? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, you declare Push() with this signature: void Push(StackType *Stack, StackElementType Item,int *k);
yet you call it like this: Push(&Stack,&Item,&k);
Do you see the problem? It would work if you called it like this: Push(&Stack,Item,&k);

As for the rest, read the error/warning messages - they pretty much tell you what is wrong. An important part of programming is being able to decipher compiler errors and warning messages so you can correct your program.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The colon and following space are just text which will be ouput along with the variable data which will be inserted in the string where the format specifiers are found (%2d and %3d).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Very wrong here! First, work out the steps your server needs to take for handling client connections. IE,

  1. Accept connection, getting a socket to communicate with client.
  2. Fork, and let child process handle that socket.
  3. Go back to accepting connection requests in parent process.
  4. When child process is done processing the connection, it terminates (exit).
  5. Don't forget for parent process to wait for signal that child process has terminated, otherwise you end up with a lot of zombie processes.

When you look at what your server does, when it forks, the child process tries to be another root server, accepting connections, and going back to do all this all over, which is not what you want it to do.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Get Ellis and Stroustrup's ARM (Annotated Reference Manual) for C++, ANSI edition. Worth its weight in gold as far as I'm concerned! http://www.amazon.com/The-Annotated-C-Reference-Manual/dp/0201514591/ref=sr_1_1?ie=UTF8&qid=1361684026&sr=8-1&keywords=Ellis+and+Stroustrup+ARM

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read from stdin?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

RTFM. Use fork()/exec() functions to create a child process, which will then communicate with the parent process via pipes or TCP/IP connections.

In any case, start by modeling how the processor and memory will work/interact. Until you determine that behavior, anything else is a waste of time. FWIW, I taught a bunch of grade-school children how to build a stack machine (processor and memory) back in 1985, just like you are tasked with now. If they can handle it, you can too!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One word - Steam. Physics engines are very difficult. If you want to do your own, you will need to work on your maths (calculus) skills. Anyway, remember that Google (search) is your friend! :-) And do have fun!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, code it and then post it here if it doesn't work as defined - we don't do your homework for you...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, your while condition is incorrect if you want to continue if xyz is even. The expression xyz%2 will return a non-zero value if it is odd, not even. So, try changing the while(xyz%2) condition to while ((xyz%2) == 0).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are trying to be too clever with line #8. Also, DO NOT use "goto" statements - bad form! I'd give you a serious downgrade for that alone if I was teaching your class!

So, what I am trying to tell you, is to write your code in a logical manner that expresses the algorithm you need to reflect. Get it right first, and then worry about efficiency. It is a LOT easier to speed up a well-written bit of code, than to correct a bad, but fast bit of code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My guess is that you didn't quite put it back together correctly. That said, if it works... :-) Anyway, dis-assembling laptops is not always a job for amateurs. I'm a professional, and sometimes they don't like to get back together like they should. :-) Then there is my grandson, who can take any bit of gear apart, reassemble it (often into something quite different), and it always works!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, I was going to suggest that you try to boot into Windows safe mode, but you say you tried that already. Have you tried to boot from an installation/recovery CD/DVD/USB drive? If you don't have one, try an Linux Live CD/DVD/USB drive (you will have to create one on another system I think). If this still occurs and you cannot boot from external media like that, then it has to be a hardware problem and you need to send it in to Dell for repair.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can get a new drive to replace the old one (internally) and install Linux on it, probably without much issue. Your wireless (WiFi) hardware may be a bit of a problem to get working - sometimes proprietary drivers and firmare is required to make it work, but generally that can be handled, and we'll happily help you sort that out - see www.linuxwireless.org for a lot of good information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As deceptikon said. Also, make sure that you scope your expressions properly. IE, instead of Set F = 9 * C/ 5 + 32, use Set F = 9 * (C/5) + 32 - that will make sure that your mathematical expressions are properly evaluated.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your code is totally wrong! The strcmp() function returns 0 if the elements are equal, < 0 if the left-side is alphabetically < than the right, and > 0, if otherwise. IE,

 if(strcmp(clr,"green") == 0) 
        printf("green");

etc. From the Linux strcmp man page:

STRCMP(3)                  Linux Programmer’s Manual                 STRCMP(3)

NAME
       strcmp, strncmp - compare two strings

SYNOPSIS
       #include <string.h>

       int strcmp(const char *s1, const char *s2);

       int strncmp(const char *s1, const char *s2, size_t n);

DESCRIPTION
       The  strcmp()  function  compares  the  two  strings  s1 and s2.  It returns an integer less than, equal to, or
       greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2.

       The strncmp() function is similar, except it only compares the first (at most) n characters of s1 and s2.

RETURN VALUE
       The strcmp() and strncmp() functions return an integer less than, equal to, or greater than zero if s1 (or  the
       first n bytes thereof) is found, respectively, to be less than, to match, or be greater than s2.

CONFORMING TO
       SVr4, 4.3BSD, C89, C99.

SEE ALSO
       bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strncasecmp(3), strverscmp(3), wcscmp(3), wcsncmp(3)

COLOPHON
       This  page  is part of release 3.22 of the Linux man-pages project.  A description of the project, and informa-
       tion about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.

                                  2009-04-21                         STRCMP(3)
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, you can have vectors of vectors (to your specified number of dimensions), or you can create a struction with the needed dimensions. Locations have "locality of reference" - ie, a moving body (car/plane/train/bus/etc) will change it's locality, but in a temporal manner - so you might want to model that as well.

This is not a trivial problem. Sometimes, brute-force is the appropriate solution to a problem. My preference in such situations is to track the absolue current location, which requires some processing overhead to keep up-to-date (delete from last known position, and adding to current location). YOU need to determine what will be best for your needs! :-)

Again, this is a GREAT problem, and as I said, there is NO one best answer to deal with it!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What deceptikon said... :-) Although, creating your own datatypes is the essence of C++ and object-oriented programming in general - define your data types and the behavior they will expose to the world.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes, to both questions. When inserting a new element into a sorted list (vector/array), don't just add it to bottom and try to re-sort the array. It is MUCH more efficient to find the position that it should be inserted in, move all the rest down one element (possibly requiring a reallocation of the array), and inserting it there directly. This is called an "insertion sort" algorithm. Bubble sorts are notoriously inefficient, especially when all but one element (or a few elements) are already in sorted order. There are methods that minimize this overhead, such as placing new elements (as you do) at the end of the array, but keeping track of the number of sorted elements, so a binary search which doesn't find the target will then go to the new elements and linearly search those. In such an algorithm, when the number of unsorted elements at the bottom of the array reach some maximum number, then the array is re-sorted and that is reset to 0.

Sorting and Searching - see the definitive Knuth volume on that (Google search appropriate here).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

More information as to what specifically your use-case is would be helpful. I use vectors and lists for this all the time, but what pattern I utilized depends a lot upon what I am trying to accomplish.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are trying to delete the iterator, and NOT the object it is pointing to.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you just tried to plug in mouse when system is powered down, and then booting it? It should recognize it and install the appropriate drivers; however, since just about no current mice use serial rs-232 interfaces, this may not work... :-( Time to get a USB mouse perhaps?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your card class is ignoring the face cards (jack, queen, king), so you need 1-13... :-) Ace == 1, king == 13.

A deck (in traditional terms) == 4 suits of 13 cards == 52 cards in total. You are only allowing 30.

So, you have started with the class definitions, but there is still a lot of work to do, both in the interfacees, as well as in the implementation (which you don't provide any of yet).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sigh. I have built, and helped build a large number of PC's without problem (I am a certified computer hardware tech, and professional software engineer). That said, whenever I need to build a custom bit of gear for myself, I usually let my local white-box builder do it, because I know he won't give it to me until it works! I provide the exact specs, and he purchases the parts and builds it, and then burns it in. If it doesn't work, I don't pay! It costs me a very little more than doing it myself (which I am fully competent to do, but he charges me less per hour than my time is worth), and it eliminates all the headaches! Yes, I know, this is water under the bridge at this point... :-(

What is wrong? There are any number of possible causes for this, including not configuring the BIOS properly, a connector loose, an inadequate power supply, a munged power supply or other system components caused by the external video card drawing too much power when you originally turned it on ... or as you mention, incorrect jumper settings!

Anyway, I'm glad you sorted it out - good for you! I'm sure this was an "educational" process!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

OpenLDAB for Linux will work well with AD, with some caveates. For the most part, it works. Go to http://www.openldap.org/ for more information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

RTFM? By UART, I presume you mean an RS-232 device, to an external bluetooth wireless controller? How is the bluetooth transceiver connected to the pic24 - via USB, or otherwise? In any case, you don't provide enough information to help. Code can only work with specific interfaces, and you are not providing that information in an adequate fashion.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. We will be happy to help you, ONCE you have made an effort to solve the problem. Do some reading on the subject of C++ and (especially) object-oriented design. Consider: you have classes such as card, deck (which would be a collection of cards), etc. So, model it accordingly. Work out, in your mind, how these things relate, and how they interact. Then write the C++ classes that reflect that behavior. Operations (methods) that the 'deck' class would expose, would be things like "shuffle", "deal", etc. Obviously (to me, at least), shuffling would randomize the cards, so you need to incorporate that concept into your "shuffle" method code.

This is a great assignment, and will teach you a lot. However, PLEASE don't ask us to help you cheat on this assignment! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A vector would be an option.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Chinese jigsaw puzzle fun!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried removing the new RAM to see if that may be the cause of this problem? Intermittent RAM problems can cause this sort of behavior, especially since laptops don't have ECC (error-correction) memory. If it has an occasional glitch, then this sort of behavior is not unreasonable to expect.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Brevity? A default constructor, copy constructor, and assignment operator are created by the compiler by default, even if not specified by the developer of the class. However, the member variables and such are not necessarily constructed as you may want (caveate programmer). As for the constructor with arguments, consider this:

class 2dpoint {
private:
    int x_pos;
    int y_pos;
public:
    2dpoint() : x_pos(0), y_pos(0) {}   // Default ctor
    2dpoint(int x, int y) : x_pos(x), y_pos(y) {}
.
.
.
};

So, you have a dynamic game, and you want to position something at a specific position when constructed, some other element may look at it in the wrong place (0,0). So, you create it where you want it to be viewed/positioned

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this a Sata, or and IDE drive? If IDE, then as mentioned you will need to be sure the jumpers are set correctly. If Sata, then that will be irrelevant. Is this to be a new boot drive? If so, then you will need to reinstall the OS on it from CD/DVD/USB drive first, otherwise there is nothing to boot from.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The algorithm won't change - only the language. Consider Banfa's post as pseudo-code and convert that to assembler... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

True enough James - thanks for the reminder! So, you may have to do some additional bit-twiddling to do that. In C/C++ this is pretty standard cruft... :-)