rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

OOo (and, in my opinion, better version of LibreOffice) should install a link in your KDE or Gnome UI menu system. Look in the "Applications->Office" menu. If it wasn't installed by default, the RPM files have an RPM to do that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Usually we use nslookup for this. The output of "nslookup google.com" returns this:

Server:     68.94.156.1
Address:    68.94.156.1#53

Non-authoritative answer:
Name:   google.com
Address: 173.194.46.64
Name:   google.com
Address: 173.194.46.71
Name:   google.com
Address: 173.194.46.68
Name:   google.com
Address: 173.194.46.73
Name:   google.com
Address: 173.194.46.65
Name:   google.com
Address: 173.194.46.70
Name:   google.com
Address: 173.194.46.69
Name:   google.com
Address: 173.194.46.72
Name:   google.com
Address: 173.194.46.67
Name:   google.com
Address: 173.194.46.78
Name:   google.com
Address: 173.194.46.66

Whereas, "nslookup mail.google.com" returns this:

Server:     68.94.156.1
Address:    68.94.156.1#53

Non-authoritative answer:
mail.google.com canonical name = googlemail.l.google.com.
Name:   googlemail.l.google.com
Address: 173.194.46.86
Name:   googlemail.l.google.com
Address: 173.194.46.85

The "Server:" and subsequent "Address:" block are specific to your ISP. These will vary. The stuff you need is after "Non-authoritative answer:".

FWIW, nslookup is the normally preferred way to look up DNS names and addresses. You can also use it for reverse name lookups by substituting an IP address, such as 173.194.46.85 for "mail.google.com", though often the name bears no resemblance to the original name, especially for google who swaps IP addresses on a second-by-second basis in order to defeat spammers and DDOS (distributed denial-of-service) attacks.

CoolAtt commented: Ok.Thanks.So its Specific to the ISP +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Boot just about any Linux Live CD/DVD. Assuming that the disc is the system drive (/dev/sda), you would do this once you have booted the disc and logged in (as root):
[code]
dd if=/dev/zero of=/dev/sda bs=1M
[/code]
This will erase your drive 1MB at a time until it is totally wiped. You can use greater or lesser values for 'bs', but I have found from experience that 1M (1 megabyte == 1024x1024 bytes) is the "sweet spot" for performance on most current gear.

WARNING! This will totally erase the drive, including the partition table and boot record! Use with caution!!!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry - I coded a bug there! :-( Here is corrected code:

public class ObjectArray {
private vector<Object> myObjects;
.
.
.
    public void deleteObjects(int index, int count)
    {
        for(int i = 0, j = myObjects.size(); i < count && index < j; i++, j--)
        {
            myObjects.remove(index);
        }
    }
};

This should (I hope) work better - untested code! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately the Iterator interface, and ListIterator class do not have a rewind() method, so I think you will have to construct new iterator instances as per JamesCherrill's post.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Trying to recover a Windows disc with Windows is like trying to fix a broken window with a hammer! This is what I do (and have never been thwarted in this):

  1. Boot a Linux Live CD/DVD
  2. Attach a USB or other drive and mount it under linux.
  3. Mount your Windows disc (also under Linux).
  4. Either copy the data / files you need (if you are going to re-image the system), or make a bit-image backup of the data using the Linux dd (disc dump) command.

FWIW, Windows (all versions) is notorious for farking the users when "stuff" goes wrong!

I know - it is too late for this, but maybe not! If you

  1. See #1 above.
  2. Run the fsck command on the NT partition that contains your data (probably /dev/sda1 or /dev/sda2) - that may restore the data to where you can read it.
  3. If #2 is successful, copy your data to a USB or other external drive.

Sorry, but data recovery is not an exact science, and I should know - I do this regularly for private clients. My day job is as senior systems engineer for a tier-one tech company. My side-line (and previous business) is as a software and data recovery consultant.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What deceptikon said. Adding to that, and giving you a "hint", read the words in the sentence, add them to an array, and then iterate from end to beginning. Have fun! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Dean said. Also, the pshared argument to sem_init(sem_t *sem, int pshared, unsigned int value) has to be 1, not 0, to share between processes vs threads.

DeanMSands3 commented: Completely missed that. Good eye! +5
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

An alternative is to create a ram disc big enough to hold those files, and on boot up copy the php file directory there after the ram disc is created (you can do this in /etc/rc.local). Then you point your php to that directory with the include_path environment variable when it starts up, or you can use the php function set_include_path($path) function in your code.

jkon commented: Clean and clear +6
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assembler language is very specific to a particular CPU instruction set. It is not something that most people (even serious software engineers) need to concern themselves with, unless they are going to work on the lowest levels of an operating system kernel or operating system boot loaders. Then, it is a necessity. I have written my share of x86 assembler code for such reasons, but I have not had to do so for about 20 years now... :-)

So, if you want to port some low-level kernel code from x86 or ARM to a new XYZZY processor from Fubar, Ltd, then you may well need to learn assembler for the XYZZY processor.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Do you want more than 1 CPU?
  2. How much memory (RAM) do you need?
  3. How many disc drives?
  4. Do you want a built-in GPU (graphics processor), or would you prefer to use a 3rd party one, such as nVidia/AMD)?
  5. What about the form factor (small vs. large - ie, desktop vs server-sized)?
  6. (Not mobo or CPU related) What about power supply? This can be critical.
  7. Manageability? Temperature sensors? ECC-RAM support?

All of these need to be taken into account. Example ECC-RAM will allow you to continue computing even if one RAM stick fails (this has saved my bacon on more than one occasion). Temperature sensor support allows you to monitor the thermal state of the system, and be proactive when stuff starts to overheat (see my comment on ECC-RAM).

As for the power supply, high-end video cards take a LOT of power, and not having an adequate supply has caused the melt-down of many motherboards and chip sets.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not a simple subject. Start with some appropriate Google searches and read a lot of the resulting articles.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A fully qualified domain name (FQDN) does use the format of server.domain.com.

Actually, it would be 'server.domain.<root>' where '<root>' can be stuff like .com, .net, .org, .co.uk, .co.tv, etc.

FYI, .com and .co.nn are both for commercial sites. The .net and .org qualifiers are for network services and non-commercial organizations only. The example above for .co.tv is because .tv is assigned to the island nation of Tuvalu, which licenses ($$) its id for TV-related sites. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, for 30+ years I am a professional software engineer. Before that, when my wife was in graduate school, I was an emergency response volunteer EMT and rescue worker for the US Civil Defense. So, I do know something about what you are trying to do.

  1. Break the problem down into smaller bits. What are the items you need to track?
  2. Consider how they are related.

The date stuff is ancillary. Use a static/constant for the date format. That doesn't have much to do with the 911 call, other than how to present the date/time to a user.

Calendar? Why? Doesn't the current date encapsulate that?

You need a couple of support classes, which might be sub-classes of "Emergency", but honestly, that is stretching it a bit. You need a class for "reporting entity", data for "type of emergency" - an enum may (or may not) be appropriate for that information, responding service (may, or may not be another class), location of the emergency, severity and type of the emergency (life-threatening, property damage, etc), and the list goes on.

So, you need to clearly think about all the information this needs to encapsulate, and which parts of that are best reflected by local data entities, and which of those entities are complex enough to have their own class.

You have more work to do! Work on that, and then report back with what you have and we can help you move forward.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You don't ask much, do you? The answers will depend upon what you intend to do with your gear. Myself, I have an almost 7 year old system that still kicks butt! Dual quad-core Intel CPUs, 8GB of fully buffered ECC RAM, 10+TB disc, nVidia 8800GT dual display video w/ dual 1920x1200 24" displays, dual DVD-RW drives, and other goodies. It cost me about $5000USD at the time. It can play dual HD videos (one on each display) at the same time.

Performance hardware? Get an Intel mobo and CPU's (4-6 cores each of up to 2 cpu chips), with good cooling gear, a 1000watt power supply, low-cost nVidia graphics (unless you intend on high-end gaming - the low-end these days will blow your socks off!), plenty of memory (16-32GB), and plenty of sata-3 drives. Blu-ray? Don't bother unless you plan on using it for backup. The encryption of commercial BD discs is a PITA to deal with. DVD's are a no-brainer. It is easy to backup your DVD's, but BD's are another thing - you have to first extract them to MKV format, and/or then convert to the appropriate format to store to either DVD or BD.

Haswell is a low-power bus and Intel Celeron CPU chip intended for mobile systems. Don't bother for a desktop or server system. The current level for desktop/server systems is Sandy Bridge as far as I understand.

There are a lot of motherboard manufacturers out there that make good gear, and they are …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need T used inside the class, like this:

template <class T>
class events : public T
{
public:
    events(){}
    ~events(){}
    bool operator==( const T& aTee ) const     // Explicit cast
    { return (aTee == *(static_cast<T*>(this)); }
    const T* getTpart() const { return this; } // Implicit cast
};

The comparison operator is a case where you would preferably use static_cast<T*> instead of a dynamic_cast<T*>.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I haven't written prolog for 30 years, but I think that your problem is that (from what you are indicating) ne(b) is not returning an entity in your database, hence is null, and comparing a non-null with null value is an ERROR as it can't be evaluated either true or false (basic predicate logic). IE, it is doing the right thing, and you need to deal with that possibility.

If you wanted to force an error to return false from a boolean function in C or C++ (and some other languages) you could do something like this (assuming results is a true/false value as the call evaluated and HAVE_ERROR indicates that an error was caught): return (HAVE_ERROR) ? false : results;

Unfortunately I have no clue how you would do that in prolog, and right now I don't have time to dust off my copy of Clocksin & Mellish and look it up... :-)

I hope this is heading you in the right direction in any case.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Mingw is a gcc/g++ (gnu compiler collection) compiler for Windows. It is ansi/posix compliant so the code you write on windows has a better than even chance of running on other systems, such as Linux, Unix, or OSX. It is also open source.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A common cause of WiFi network slow-downs is due to using the default signal channel. Example: on 802.11b networks, there are 13 channels. The default that all WiFi routers (access points) use is channel 6. Other AP's that your systems can see are likely using channel 6 as well. So, go into the configuration tool for the router/access-point and change the channel to something other than 6. I have found that in many situations this helps tremendously, especially in an environment where there are other AP's in visible operation - common in commercial (business) buildings.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

All great answers. Just remember that K&R is (in internet time) from the dark ages! At the time K&R wrote the book on their invention, the C language, they were using a system (PDP-7 or such as I recall) which had a 16 or 32-bit architecture. Integers (and long ints) were 32-bits, and (as today) shorts were 16-bits and chars 8-bits. Modern systems (64-bit cpus) have 32-bit ints, 64-bit longs, 16-bit shorts (still), and 8-bit chars (still). On 32-bit systems today, you can specify a 64-bit integer as a 'long long int', which should be the same on a 64-bit system, though depending on the compiler, a long long int may be 128 bits on a 64-bit processor system - caveate programmer! :-)

To reiterate my favorite quote - the nice thing about "standards" is that there are so many!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I have written assembler code for Intel 8048 and 8086 as well as Sparc chip sets. Each target processor has its own instruction set, so assembler programmers (very low level - direct to the processor) generally focus on one processor family. Mostly today, you can write C code that will be translated to the appropriate machine language - only the compiler/assembler writers need to deal with the CPU directly. In fact, modern compilers translate source into an abstract machine language (COFF, ELF, et al), and only the linker needs to take that and turn it into the target processor code.

So, while (in the Linux environment at least) you may need some assembler for kernel development, it is rare. FWIW, my last touch of assembler was for a Sparc (Sun - now Oracle) device driver about 6 or 7 years ago, and before that device drivers for an x86 real-time operating system 20 years ago! :-)

FWIW, my Intel 8086 assembler/machine code reference manual still has a place of honor on my bookshelf...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Place the "Study making forms" last in your list of stuff to learn. Add "Study C++ GUI tool kits" before that - the forms will be part of that... :-)

So,

  1. Study the basics.
  2. Practice the basics, gradually getting more complex with your code.
  3. Study C networking (sockets, etc).
  4. Study multi-threaded programming and concurrency control.
  5. Study back-end api's. MySQL is a common one and has good C++ support. I use it all the time.
  6. Study C++ GUI api's such as Wx and Qt.

That's the order I'd take if I were starting over (now that I have 20+ years of C++ hind-sight to draw on). Fortunately, I already had the C networking stuff down pat, having implemented an entire C-based TCP/IP stack for a real-time operating system, from the DDN White Book specifications (the TCP/IP "bible").

This week I'm mastering web programming with PHP... Got my first MySQL connection working today. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just a cursory glance, but you have defined all of your arrays to have 2 columns. Why are you iterating over the passed column count? Also in your sub() function, you define g as a 2x2 array, yet you overrun the size with your g[3][3] = f - e.

You need to do more studying, and understand what you are doing. It is fundamentally, and fatally flawed at a number of levels.

H_beginner commented: I have studied and solve the problem. I wanted to know if I can make the matrix size entered by the user dynamic. Currently I have fixed it as a 2*2 matrix. +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can also use symmetric encryption, where the same key is used to decrypt the message as is used to encrypt it. Depending upon the encryption algorithm used, this can be more secure than public key encryption when JorgeM talks about. The major issue with this is how to securely exchange keys with the other party. Obviously, if you can make the exchange personally without sending over the network or other public communication medium, then it is a true private key exchange.

In fact, a lot of secure communication is handled this way, after a fashion. The cost to encrypt/decrypt using public key pairs is high in computer cycles and time, so often a symmetric key is transmitted using a public key system (such as PGP). That key is much shorter than a communication that may be hundreds or thousands of pages of data, so you pay a lot for a little message (the symmetric key) and less for the bigger part of the communication.

A great book that covers these subjects in a very readable manner is Bruce Schneier's "Applied Cryptography". First published in 1994, it is the "bible" of many professional security engineers today.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In virtualbox you have a number of machine settings. One is for the virtual video adapter (Display settings). You need to increase the memory to the max (128MB), and for Linux clients enable 3d acceleration (2d is for Windows operating systems). Doing this I can use a 1920x1200 HD display with full color.

theashman88 commented: Thanks for the help. Quick and clean +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Two problems. One is that this thread is 8 years old! Two is that writing good random number generators is not a trivial undertaking, and thinking it is just shows your ignorance of the subject. Read this: http://www.phy.ornl.gov/csep/CSEP/RN/RN.html

From the document, 2 relevant 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)

nitin1 commented: those quotes are simple awesome!! :D +3
deceptikon commented: Yes. +12
JorgeM commented: very true.. nice.. +12
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What OS are you running? There have been issues with Windows 7 that makes it necessary to uninstall all the USB devices (in the hardware manager tool) and then reboot. The OS automatically reinstalls the required drivers. After rebooting, reattach the USB drive and you should get your connectivity back. I've been having this problem on 2 Windows 7 systems for the past 2 years... The USB ports seem to work for Most everything else, but not for USB flash drives. So far, I have not lost any data.

FWIW, a number of my colleagues have had the same problem, though it has also has been an issue with some usb hardware interfaces to our device diagnostic tools that integrate with the JTAG interfaces on our consumer gear.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ah, the ageless "compiler optimizations vs. hand optimizations" argument (discussion)... :-) After 30+ years writing both real-time and large scale system code I find that simple beats all at the "is it fast enough" race! If it is simple, the compiler can optimize in ways that us mere mortals cannot even imagine! Well, maybe we could imagine if were were compiler designer/writer boffins! ;-)

All that aside, I DO use left/right shift operations if I need to do factor-of-2 multiplies or divides, although the logic to determine how many bits to shift may well be more expensive than letting the compiler figure it out. When I am uncertain which would be better, then I try coding it both ways, run it in a REALLY BIG loop (with compiler loop optimizations disabled), and compute the absolute timing. However, the caveat here is you need to be sure your system isn't doing anything different from one run to the next, and then make multiple runs, averaging out the results. It is still, in computer terms, a SWAG (Stupid Wild Assed Guess), but it will be reasonably close to "truth".

Disclaimer: I am a senior systems/performance engineer for Nokia Mobile Phones (soon to be Microsoft Mobile Phones) and am responsible for end-to-end performance engineering, modeling, and measuring for thousands of servers and 100's of millions of phones world-wide. I still write a LOT of C, C++, Java, JavaScript, Php, and other code... The only programming language(s) I don't use much any longer (unless …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, to get a random number between 0 and 25 (exclusive) using rand(), use a modulus operation: num = rand() % 25

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please do your own homework! That is why you are in school, to learn this stuff, and not to get the answers from someone else! :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some software works well with Wine, and a lot doesn't - they are just too wedded to the Windows ecosystem. I only run Linux and use Wine to run some tools as well as a couple of serious applications, such as my favorite UML development tool, Sparx Enterprise Architect (EA). Sparx has done a lot of work to make sure that EA works well on Wine since they don't have the resources to build both Linux and Windows versions, yet they have a LOT of Linux customers.

So, basically your experience may vary! Simple tools - usually no problem. More complex applications - often don't work. Example: I could run Photoshop on Wine up to version 7. All versions after that are fubar... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Basic for loop

for (int hours = 1; hours <= totalhours; hours++)
{
    // Compute distance travelled - distance = hours * speed
    int distance = hours * speed;
    // then print the disance using cout
    cout << "After " << dec << hours << " hours at " << speed << " mph, "
         << "the distance travelled is " << distance << " miles." << endl;
}

You get to figure out the flow chart... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately, dropping a system is not covered under warranty. My advice is in any case to send it into the manufacturer for repair - you should be able to get an RMA (Return Merchandise Authorization) from their web site. DO NOT trust this to third parties! When fixed by the manufacturer, it will at least be covered by their own warranty for repairs - likely at least 30-90 days. If it is still fubar when you get it back, just send it back to them to fix again. Most likely, they will replace the system with a factory refurbished one in the first place.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The original ethernet was invented by Robert Metcalf at the Xerox Parc (Palo Alto Research Center) in California in 1973-74. Here is the Wikipedia article about it: http://en.wikipedia.org/wiki/Ethernet

Its design was inspired by the ALOHAnet and incorporated by Metcalf in his PhD thesis.

FWIW, I have personally known Metcalf since the early 1980's when I sold 3-Com Corporation their first 100 IBM PC's.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I would advise reading the code for open source tools such as Calibre to figure out how to do this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, specifying each element as a char means they only can have one character! I suspect that you don't want to do that... :-)

Use this (or something similar):

class Book {
    private:
        std::string author, publisher, ibn;
        double price;
    public:
        Book(); // Default constructor 
};
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is a variety of an insertion sort - inserting an element in the proper location of a sorted list so that the list / array remains sorted. I developed code for this 20 years ago (in C/C++). I used a modified combination of bsearch and qsort. It would search for the insertion index of the array, push the following elements down one position, and then set the element in the index provided. Doing this efficiently means that you want to intellegently resize the array so that you aren't doing reallocs for each insert, especially if you are dealing with 10's of thousands (or 100's of thousands) of records, which we had to deal with. I used a binary reallocation scheme, so that every time I had to reallocate the array, I would double the number of elements.

I'd provide sample code, but it belongs now to Applied Materials (the 800lb gorilla of semiconductor manufacturing equipment and software).

In any case, the algorithm goes like this:

  1. Use a binary search of the array for the location to place the new element.
  2. If necessary, reallocate the array to hold the new element.
  3. Move the rest of the data down one element (memmove() works well for that).
  4. Set the array location found to the new element.
  5. You are done. :-)

FWIW, you only need 32 comparisons to find the location in an array of 4 billion elements.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume you mean "use the dot operator"... :-) If so, the answer is yes!

pars99 commented: Yes, sorry about that. Thank you. :-) +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Simply put, the dot (.) operator is used to access members of either a full instance or reference to and instance of an object. The pointer-to (->) operator is used to access members of a pointer to an instance. Ancient Dragon gave you some good examples.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you... :-(
Make an honest effort to solve the problem, post your code here along with the difficulties/errors you are having, and we may decide to help; however, if you don't make the effort first, you can forget about it!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

On the whole, I agree 100% with Mike2k and AsmGuy; however there are a couple of Windows apps that I run in Wine that have no suitable Linux alternatives. The most important one is my UML modeling / software engineering tool, Sparx Enterprise Architect. They have gone to a lot of effort to make sure it works well with Wine since a lot of their customers use it there, yet they aren't a big enough company to support a dual-environment (Windows/Linux) code base. And yes, I have used or evaluated most of the UML tools available for Linux and NONE of them come close to the capabilities of EA, yet it costs under $200USD per seat for a Professional Version license that does everything from requirements collection to forward/reverse code engineering to live model execution/simulation.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The only way is to either install Wine and then see if the exe's Windows installer works and the executable likewise, or to install Windows in a virtual machine and run it there in the normal manner. I use both techniques.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Performance engineering. Add C++ to your skill set - consider Java as C++ with training wheels (like a kid's bike). I make a good 6 figure salary doing performance engineering for a world-wide networking operation. I use C++ w/ C to develop network and application performance monitoring and diagnostic tools. Why C++ and C? Because we want these tools to have minimal impact (memory and CPU) on the systems they run on, yet be as efficient (fast) as possible. In the past, our engineers used Java and scripting languages to perform these functions, but they are too heavyweight and slow to be sustainable. The tools I design and write have been shown to have negligible impact on the systems and networks they run on.

Another skill to gain these days is "big data" - Hadoop, HBase, OpenTSDB (time-series data), etc. And make sure your skills include Linux/Unix systems engineering. 90%+ of network servers running today are Linux systems.

somjit{} commented: i was begining to lose hope , this was a great help. +4
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have a semi-colon at the end of the declaraion line. Remove that. Ie where you have

void playerCMD();
{
.
.
.
}

You should have

void playerCMD()
{
.
.
.
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How do you mean? Reset to factory specs, or to totally format the internal "drive"? Any why on earth would you want to wipe your phone completely?

timmyjoshua commented: yeah, how to format the drive.... cos splitted into partitions to test the 4.2 android os. Now, i want to remove the partition so that 4.2 os will be the os on the whole phone........ +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, double post and mark other as solved? Which is it? :-(
Normally, you don't create .exe files with java. You create .jar files which the JVM will execute. There are compilers which will take java code and/or jar files and turn them into native executable images. For Linux there is GCJ (gnu compiler for java) which will happily do that for you. For Windows there are the Cygwin and MingW compilers. Here is a link to the Gnu Java Compiler web site that explains a lot: http://gcc.gnu.org/java/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The key thing about C++ is object-orientation. Learn how to model your classes, their relationships, and behaviors. Then, turning that into class structures and code becomes a lot simpler. I can say this without reservation after 20+ years of C++ and object-oriented system design and development as senior and principal software engineer for major global companies and software systems used to run some of the biggest manufacturing and other systems in the world. My current CV is available in my DaniWeb profile. :-)

As for books, I heartily recommend the "Annotated Reference Manual" of C++ by Ellis and Stroustrup (the inventor of C++).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Talk about comparing apples (sic) to oranges... :rolleyes:

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This isn't complete. The variables currentBestScore and positions are not defined here. Did you mean currentBest, and square instead?

Seth Lam commented: Yes I'm sorry, mixed up my variables +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you have code to post? A description of the algorithm? What you are saying is not enough to help you.