rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Gaming-oriented computers tend to have high-end processors, video chip sets, and lots of memory. These are good things if you want a high-end development system. This is kind of what my company provides its software engineers for their laptops, a system with:

  1. An Intel i7 dual core 3.2GHz hyperthreaded CPU
  2. 8GB RAM
  3. Dual Intel/nVidia graphics processors
  4. 320GB HD
  5. 17" 1920x1080 full 1080p HD display

If I were playing games, this would be a really great system. However, since I do major software development on it, running cell phone emulators, multiple Linux virtual machines, and a load of office automation/communication tools, games are not on the menu (except maybe for an occasional Angry Birds session to work out frustrations!).

FWIW, this is a Lenovo laptop.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To see all partitions on all discs, run the command "fdisk -l".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I usually use the "less" command, which will let me look at the file, and optionally edit it if I want.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Check out the inotify system services. They let you be notified when a file/directory has been changed. See the inotify man page: man inotify

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try a different name, such as myReadFile() instead, as this may be conflicting with some other function of the same name. Alternatively, you might try placing the using namespace std; directive before the declaration of readFile().

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A steady 5v or 0v signal is not a standard RS-232 signal. First, you need a specialized driver capable of detecting that the voltage change is valid and not just a transient glitch (not uncommon), and then passing the appropriate information to the user-space application (java in this case). Honestly, this would be a lot easier in C, and may be simpler to create a JNI to the C code that will let your java application to detect these state changes. Have fun, and good luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, JMHO in that the new "standard" is fine, but you should still support the old bbcode blocks.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Read line into buffer.
  2. Use strtol() to read string into number (integer) variable.

Example:

char buffer[1024];
char* p = 0;
int value = 0;
istrm.getline(buffer, 1024);
value = (int) strtol(buffer, &p, 10);

istrm is an input stream that you can read a line from.
The strtol() function will set the pointer 'p' to point to where the
conversion stopped due to an invalid numerical character. You can start
scanning from there on the next call to strtol().

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please describe your problems. Just saying that "it is having serious trouble..." is not particularly revealing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These are system functions related to setjmp/longjmp instructions. They are probably part of the glibc library (just a guess). Look on the GNU web site (gcc) for the source code. According to the comments in /usr/include/ucontext.h (the header file for these instructions), it is part of the GNU C library, as I surmised.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you would like us to solve your homework for you? Do we get your degree when you are finished with school? Make an effort to solve this on your own first, and then we might think about helping you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The new format is terrible. No editing of posts is apparently available, some old (in last 2 days) articles are not accessible (404 errors). My advice, as a senior systems engineer for a tier-one world-wide engineering company? Roll back to the old version until you sort out this cruft! Until you do get it sorted out properly, I will no longer be contributing to these forums!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Asking us to solve your homework assignment is cheating! You need to make the first step / effort to solve / answer the question, and then we might help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You know as much as I do about G-SOC. Submissions by potential participants opens on the 26th, but you can connect with (via IRC - Internet Relay Chat) mentoring/hosting companies and others before then in order to get ideas of what they are looking for, etc. I realize that English is likely not your native language, but I think you need to try to understand what is being said on the SOC web site a bit better. I have told you all I can.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ah! Forgot about that new feature, although just how many current compilers support the full C++11 standard? In a few years when it is more widely supported, then using delegated constructors will make sense. At this point, I think that most server-level systems (RHEL 5 and 6 for example) will not be that up-to-date. Anyway, thanks for pointing it out. I read about it in an article sometime in the past year or so, but not using it, I forgot about it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I use an X-Windows editor for Linux or Cygwin on Windows called nedit. On Windows I use notepad++. The nedit editor will match braces very nicely, and will, if you want, auto-indent everything for you, as well as auto-indent as you type in code. It knows about many programming languages, and will deal with each appropriately - everything from Ada to Yacc, and most stuff in between such as Java, Python, Perl, Make, Matlab, Verilog... It was originally written by a staff member of the Fermi National Accelerator Lab computing division, but has been released into the open source community and is now hosted on SourceForge.net.

zeroliken commented: Thank you +9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think you can also do this these days:

char guidStr[] = "{00000000-0000-0000-0000-000000000000}";

and it will have the same results, but is easier to read! Old compilers would not do that, but current ones, for probably the past 20 years... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, Google and some other groups sponsor students to help improve a variety of open source projects, and the students chosen get to spend the summer coding, and getting paid for their work. Plus, they get a lot of exposure to some of the top people and companies involved with open source, who may well end up hiring the students after they finish school. We hire a number of interns to work on similar projects ourselves and the good ones are offered full-time positions when they graduate.

So, the three steps are:

1. Propose a project for your summer of coding.
2. If selected, spend the summer coding away.
3. Get paid for your summer of efforts.

They start taking student applications March 26, 2012 at 19:00 UTC (7:00pm GMT). So, you have about a week to come up with an appropriate project if you are interested in applying. According to the calendar on the G-SOC site, from today until the 26th, the activities are "Would-be student participants discuss application ideas with mentoring organizations". You need to sign-in, sign-up, and get on the the IRC chat lines with the mentoring organizations. Here is the FAQ page about getting connected and such over an internet chat channel: http://google-melange.appspot.com/document/show/gsoc_program/google/gsoc2012/faqs#irc

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Except it should be char *str[] = {"hello","my","name","is","tubby"}; :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Too long? yes!

Step 1, describe what the game does.
Step 2, tell us what is not working right.
Step 3, post only the relevant code (class structures help as well). In your case, you are including a lot of timing and other cruft that is probably totally unnecessary to deal with your problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I suppose that if you want to call a different version of a constructor inside another of the same class, that you could, although it is HIGHLY ill-advised! So you could do something like this, I suppose (danger Will Robinson!):

class ClassX {
private:
    int knit;
    int perl;
public:
    ClassX();
    ClassX(int);
};

ClassX::ClassX() // default ctor
: knit(1), perl(2)
{
   this->ClassX(6);
}
ClassX::ClassX(int warp)
: knit(warp/2), perl(warp)
{
}

Just remember, that any base classes ClassX is derived from will now be constructed twice as well, possibly resulting in "interesting" side effects, resource depletion, etc.

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

Next time, try some indentations. It makes things a LOT easier to read!

#include <stdio.h>

int main( void)
{
    int s; // scanf return status

    double d, y1, y2, tz, tz2, t1=0, t2=1;

    while( 1) // until end-of-file or error
    {
        s = scanf("%lf",&d); // scans for given values
        if( s != 1) // could not read one double, must be end-of-file or error
            break;
        y2=y1;
        y1=d;

        if (y1>0)// I have two possibilities y1>0 and y1<0
        {
            while (y2>0) //there would not be a zero crossing, so code would break out of loop
            {
                break;
            }
            while(y2<0)
            {
                tz=(t1+t2)/2;
                printf("%g/n",tz);
                break
            } // gets the first tz value
            else if (y2 != 0)
            {
                break;
            }
        }
    }

    if (y1<0)
    {
        while (y2<0)
        {
            break;
            while(y2>0)
            {
                tz2=(t1+t2)/2;
                printf("%g/n",tz2);
                break;
            }
            else if (y2 =! 0)
                break;
        }
    }
}
t1++;
t2++;
printf("%g/n",(tz2-tz)/2);
return 0;
}

Doing that, and matching up the braces (my editor does that nicely), you can see that there are SERIOUS structural problems with your code. Clean them up first before you continue with this thread.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

G-SOC == Google Summer of Code. Try this site for more information: http://www.google-melange.com/gsoc/homepage/google/gsoc2012

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some times the operating system takes a bit of time to see the external device. Plug it in, and if it isn't recognized in about a minute or so, then try cycling the power to the drive while it is plugged in to the USB port on the system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Re. battery issues. This is a common problem with current lithium-ion batteries. The only last 1-2 years before they have to be replaced, which runs about $99 from the dealer. You can get better prices on OEM units for popular laptops from Buy.com and other online vendors, but they are still too expensive, IMO.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Dell used to have a 3 year warranty on their business class laptops (Latitude). Now, they are only giving you a 1 year term. I think that the extra cost for a 3 year warranty is probably worth the price. My current D630 is now 4 years old, and still going strong, but then I had to get it fixed a couple of times under warranty! The 630 still has been more reliable than my previous D600, which had to get a new drive and a new motherboard at different points in its career. Fortunately, all those repairs were under warranty, but outside of the current 1 year period... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I don't know. My work Lenovo with the standard battery is lucky to get 2 hours. I'm thinking to order a 9-cell battery in order to get more time when I am disconnected from a power source.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is their page w/ the beep diagnostics: http://us.msi.com/service/TroubleShootGuide/

It is probably a RAM problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is probably due to how you have configured your USB setup in the BIOS. Whatever it is set to, try the opposite setting.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What are you using for anti-virus?

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

In your BSTNode<T> assignment operator you have a serious leak. And the solution is not simple unless you create a BSTNode<T> copy constructor so you can do this:

BSTNode<T> & operator=(const BSTNode<T> & other)
	{
		if(this != &other)
		{
			// First, clean up old values.
			delete value;
			delete left;
			delete right;

			// Now, assign new values.
			value = new T(*(other.value));
			left = new BSTNode<T>(*(other.left));
			right = new BSTNode<T>(*(other.right));
		}
		return *this;
	}

This is part of what Mike_2000_17 was getting at with his reference to DEEP COPY operations. You have to do the same thing for the copy constructor. I didn't look at your code beyond this, but it is indicative that although you are starting to think about how your code functions, you need to become aware of the pitfalls of just passing pointers around. Also, look into using smart pointers. They will help you simplify your code in that you can assign a pointer to one, use it like a pointer, but when it goes out of scope, it will be deleted automatically so you don't have to futz with all the delete operations that you would have to use otherwise.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What operating system and browser are you using?

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.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You figured out diff just fine - differences between two files and/or directories. Read the man page for more info: man diff

As for git, that is an entirely different animal. There are a number of source control / configuration management systems available for Linux and other operating systems, such as (starting with oldest/least-used) SCCS, CVS, SVN, and GIT in the open source world, and proprietary ones such as ClearCase and AccuRev, et al. The purpose of these tools is to store versions of software and associated files on a versioning basis, so you can look at the differences between version A and version B for example, and roll back components with introduced bugs / unwanted features. These are some of the most important tools in software engineering environments.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Basically, you need to restore the master boot record. Here are a couple of links that help:
http://pcsupport.about.com/od/fixtheproblem/ht/repairmbr.htm
http://ubuntuforums.org/showthread.php?t=622828

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'd rewrite your signature line to

"Work delivers us from the three great evils: boredom, boredom, boredom. The money work earns delivers us two great benefits: practicing our vices, and fulfilling our wants."

- Rubberman

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One thing that has worked for me when I had a drive that was acting up, was to do a full format, not the default quick format, with Windows. Sometimes bad sectors will not get mapped out of use by the device itself, so when Windows does a full format, it will mark them as unavailable in the allocation table of the file system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I haven't used a floppy in years. In fact, none of my current systems have one, and don't need them. I keep an old system around with a drive so I can read old discs, if necessary. In fact, I should probably use it to read my old collection just to store the data (some useful software I wrote in the past) on more up-to-date media.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, I am running 64-bit Win7 on my laptop at work, and both 32-bit and 64-bit java work just fine, although for some stuff, 32-bit is better. I run eclipse for java software development, and have built entire cell phone browsers on it without problem, as well as running java-based phone emulators. So, there is something really wonky with your system. Have you tried reinstalling the OS from bare metal?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, at least you know that the port does work. Sorry but I'm not a Python programmer, so I can't tell you if there is a problem with the code. In any case, you should NOT have needed to create the device node for /dev/ttyS0 - that should by default be auto-configured by the OS for the COM1 port on your system. Do make sure (again) that the COM ports are enabled in the BIOS.

FWIW, I've used a lot of serial ports with a lot of Linux systems, and never saw this sort of problem. :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Right-click on the speaker icon in the top menu bar and select "Sound Preferences". Click on the Hardware tab and select the hardware you want to use. Ditto for the Input and Output tabs. In the Hardware tab, select the appropriate profile for the external speakers, and then you can test them with the "Test Speakers" button. I do this to switch between speakers, headphones, or bluetooth headset.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you running Windows 7 or Linux? Also, what version of Java did you try to install, and was it from Oracle? FWIW, I have a system with a very similar hardware configuration and Java runs without problems at all both with Win7 and Linux.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sounds like fodder for the Snopes - New Urban Legends web site.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ah. Not really necessary. Ubuntu would have happily nuked the drive for you and then installed itself on it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

lol. many many years ago ,,i say new to linux but actuall made my first live cd/dvd 7 or 8 yrs ago ,i have a Live Puppy Linux on a multisesion DVD [can make changes and save to the dvd when i shut down,]made at or about 2004,play it with rarely

Well, I use Linux almost exclusively at home, and mostly at work as well, though I have Windows XP running in a VM at home, and my work laptop runs Windows 7, but with a Linux Vm on it for system software development and testing!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As to what happens when you run out of letters (/dev/sdz), I don't know since I have never had that many physical drives attached to my system!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Anyway, this is why I label my drives / file systems. Mounting them is a lot easier. So, in /etc/fstab, I mount them using the LABEL=name syntax. My array is named afs-ts02, the /home lvm is mounted by its lvm device name, /dev/mapper/VolGroup00-LogVol00, and the additional drives are labeled as afs-esata-1 through afs-esata-4. I had another drive (afs-esata-5), but it is starting to fail, so I leave it off most of the time. When I get a new drive, I'll copy it to the new drive and it will then become /dev/sdn instead of the thumb drive.