rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are any number of distros it could be. The wallpaper may give a clue, but I'm not familiar with it. In truth, unless the name/logo is visible on the GUI, you would need to look at other things.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

fork() returns the child pid in the parent, and 0 in the child, unless there is an error in which case it returns -1 to the parent. Then you need to run execl() in the child. Re-read my description of the process.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. fork - this returns the child PID to the parent, and 0 to the child, unless there is an error, in which case it returns -1 and errno is set and no child process is started.
  2. In the child, run execl - this will transform the child process into the exec'd one, returning -1 if it fails, setting errno appropriately and not returning if it succeeds since the exec'd process will take over the child's PID.
  3. Whichever process is to be the database/server, it will open a socket on the appropriate TCP/IP port, accept connections, listen for connections, and when it gets a connection request use the select function to wait for data to arrive. Usually this is done with a timer so that if no data (requests) come in within a set period, it will go back to checking for other connections (assuming more than one client can connect to the server). If you only will accept the one connection, and that from the parent, then the timer is not required. Alternatively, you can fork a thread to process incoming requests for each client, but that is a more complex model.
  4. The client process will create a socket and connect to the specified port, and once it gets the connection, it can then send request data to the server and get the reply data in turn.
  5. When the server's select call indicates there is data from the client, it can read the request, process it, and return anything it …
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Since Game is an abstract class, you need to create a concrete class derived from it without the playOneGame method, and then instantiate it, and run that method, testing the output from a number of inputs. You will have to implement the abstract methods declared in the Game class.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, I'm not sure if the space in front of %d in the scanf() function will require that the user input a space before the number.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you mean the Simple and Fast Multimedia Library (SFML)? First I've heard of it, but the best way to check out something like this is to do some prototyping with it and see if it works for you. Since it is open source, do report bugs or usability problems to the development group. Without the feedback of real users, they can't strive to improve it for the rest of the community.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It has great reviews and if I could get an invite I'd buy one in a nanosecond!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If it ain't broke, don't fix it. My Dell D630 (dual core 3GHz CPU, 4GB RAM, 500GB 7200 rpm HD, 1Gbps ethernet, bluetooth, wifi, HD display) is 8+ years old and still handles all my embedded programming, virtual machines, video processing, and software development chores without complaint. The audio stopped working recently, so I may have to replace it sometime soon... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

From the sounds of it, it seems to me that you may have a flash drive plugged into the USB port and the BIOS is set to boot from USB first. As 3knur8 said, go into the BIOS and check the boot order, or if you have a USB flash drive plugged into the system, remove it before booting. It is possible that the flash update changed the boot order, causing this problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Change those ” to this ".
I don't know what they called :-D

Good catch Sarkurd! He was using back-double-quotes instead of regular double quotes for the strings. My old eyes missed that... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you sure both access points are broadcasting their SSID's? That can be disabled so a network is invisible. He should be able to connect to the "invisible" network via its SSID explicitly. Once he does so, his system should be able to remember and see it in the future.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, show your errors. Just saying it doesn't compile isn't helpful.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, it has been a couple of years since this post. I have to say that folks at Daniweb did get their stuff together. It has been seriously improved, without messing up the interfaces and other cruft that worked. Good work folks! And thanks for all the fish! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to scan into an integer value, not a string. Also, tell the user to enter a number instead of a string. IE:

int main()
{
    int num = 0;

    printf("Enter your number: ");
    fflush(stdout);
    scanf("%d", num);
    printf("Your number is %d\n", num);

    if (num % 2 == 0)
    {
        printf("Even.\n");
    }
    else
    {
        printf("Odd.\n");
    }
    return 0;
}
<M/> commented: thanks +10
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

About A/V scanning, i don't have any thing like that on my pc. I disable anything that isn't usefull and keep a eye on what's running.

I usually use ClamWin for a decent open source scanner that only does on-demand scanning. It can also scan memory which is occasionally useful. Cheap at 2x the price - free! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Same answer. It is your problem to figure out. Describe first here what you think you should do to solve your conundrum. Describe how you might do it, step by step. Plain language is OK - code can come later.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The fact that the OS doesn't detect the drive at all is not a good sign. Usually that means the drive controller has failed. TylerD75's suggestion about getting a USB (or eSata) docking bay to see if the system can access the data is not a bad one. I usually leave the drive in the system and boot a live Linux CD/DVD disc, or a Live USB thumb drive and see if Linux can access the device. If it can, then the controller is somewhat functional, and possibly only the file system is munged, which can often be restored to the point where you can at least get most of your data off of it.

Good Luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to run thread1 inside thread2 and create a mutex that thread1 will lock and set the data value, in the meantime, thread2 will wait on the mutex and when thread1 releases it and thread2 gets the lock, it can multiply the value (t1.a) by itself and then print the value. Note that I am not writing your code for you... :-)

So, see what you can do with this and then we will critique your code, other than to note that there is no synchronization in your code, which is why my comment is trying to show you what to do to fix that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Until you post your code I can only say that we don't do your homework for you. You have the solution algorithm in the pseudo-code. Just apply the language to the solution.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are missing a couple of curly braces. Try this instead:

    #include <iostream>
    using namespace std;
    int main ()
    {
        int num1 = 5, num2 = 10;
        if (num1 < num2)
        {
            cout << ”num1 is less than num2” << endl;
        }
        else
        {
            cout << ”num1 is not less than num2” << endl;
        }
        return 0;
    }

Proper bracing of conditional statements and better indentation help a lot in avoiding this sort of problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You left off the command name which is "ls", as in ls -l ./HelloWorld

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Get more RAM if your laptop can handle it. Also, how are the VM's in VirtualBox configured with regard to number of cores, amount of RAM, etc? I would suspect that your performance issues are related to swapping of virtual memory to disc. A solid-state disc can help there. There is also the issue of on-access virus scanning which most A/V tools implement by default which also causes serious performance issues. Usually you can disable that in the Security Center, but it will make your system nominally more susceptible to virus infections.

So:

  1. More memory.
  2. Better VM configuration.
  3. SSD instead of regular hard drive.
  4. Disable on-access A/V scanning.
  5. Faster CPU with more cores.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Download the free version of the Cloudera Hadoop management tool. It will nicely do all that cruft for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to either be online, or you need to call a phone number that should be provided in the Windows packaging.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume you are running Windows? There is the GNU MingW compiler, available here: http://mingw.org/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might want to run the full disk check utility (requires rebooting) to see if there are bad sectors on the disk. If the DLL is stored on a bad sector that is having read problems, that could explain this issue.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried running the recovery disk/partition?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. The command "ls -l ./HelloWorld" should output the file name, ownership, and permissions. If it isn't there, you should get the error message "ls: cannot access ./HelloWorld: No such file or directory". If you do get the appropriate information, then post the output here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think that Moschops means something like this:

int* func1( size_t cnt )
{
    int* pA = (int*) malloc( cnt * sizeof(int));
    for (int i = 0; i < cnt; i++)
    {
        pA[ i ] = i;
    }
    return pA;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Executing code from ssh is not a problem. There are several possible problems. One is that your shell may not be in the directory you think. Another is that the permissions you think you gave the file are not correct or the file is no longer there. Try executing ls -l ./HelloWorld to see if it is there and that it has correct execution permissions. Finally, did you compile the source using either a compiler on the device, or the correct cross-compiler on your host system? Also, did you login as root, or another user? Bear in mind that allowing root ssh logins is considered insecure - most systems will block that in the sshd configuration files.

One last thing. The home directory for root's account is usually /root, not /home/root.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Didn't you ask this question already? I already answered the question in your previous post. Please don't double post... :-( And you posted it as mnewsome.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. Please make an effort, post your code here, and we may help you sort out your problems if it seems appropriate.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is bad:

 *A = (int*) malloc( 2 * sizeof(int));

 for (int i = 0; i < 10; i++){
    (*A)[ i ] = i;
 }

You allocated room for two integers in the array, but are setting 10 items.

Additionally, in main(), you need to initialize A to 0 (NULL), and test it for null before iterating over it and deleting it after calling func1.

As a result, you have seriously munged the stack, and the error you got may not be exactly what happened, you should have had a SEGFAULT core dump...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When multiple applications try to send/receive data at the same time over the same network link/connection, the network driver will mostly queue them in FIFO (First In, First Out) order. The network hardware will send/receive until it has reached its performance limit, which with modern hardware ports, is as much as 1Gbps (1 gigabit per sercond == 128 mega bytes per second). WiFi is slower, and most internet connections are even more so.

Anyway, there are delays. It is just that they are so short most of the time, you will never notice them. That's why I can stream audio over my internet connection while viewing a YouTube video at the same time, and not notice that there is buffering going on, unless my wife decides to upload another video to YouTube or Facebook at the same time... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Install and try Firefox (Mozilla) to see if the same thing happens. If not, then you might uninstall Chrome. Yeah, a PITA for sure, but if something has installed a bad plugin (or infected one), and you can't figure out what it is, then that may be your only recourse.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If it shows the BIOS POST (power-on self-test) screen but nothing after that, then the default vga gear in the video card is working ok, but likely the high-resolution stuff is not. Have you tried another video card?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This may help: https://en.wikipedia.org/wiki/S-box

That said, the logical bit-wise operations are intended to mask specific bits to generate the index to the sbox for lookup. The value 0x20 == (binary) 100000 & src masks out all but the top bit in src.

value 0x01 == (binary) 000001 & src masks out all but the bottom bit in src. << 4 shifts that (if first bit is set) left by 4 bits, so if the lowest bit is set in src, the output of that is 010000.

The last element is 0x1e which is 011110 which will mask out the upper and lower bits of the 6-bit value, and shifting that right by one will result in possible a value (maximum) of 001111 binary.

Finally, the | (or) expressions combines all of those masked values into the real index to the s-box.

FWIW, the DES algorithm was the result of years of research by the top boffins at IBM and serious vetting by the NSA. It is not strong by today's standards, but it was good enough at the time that exporting the algorithms was prohibited for many years. Now, it's posted on Wikipedia! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Hardware: has mass. If you drop it on your foot, it hurts.
Software: bits have no mass. If you drop it on your foot, you won't know it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is better to use a vacuum to clean the inside of a computer. Blowing compressed air to clean it can blow dirt and detritus into connections causing this sort of problem. It is likely that this has happened with the video card, or other contacts.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

iOS and OSX only run on Apple hardware. You will have to replace your laptop. Another solution is to install Linux on the laptop if you cannot afford the new hardware gear.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes. Most distributions have already released the patches required to fix this. Now, people just have to update their systems to incorporate the fixes. This will be simpler than installing the heartbleed SSL bug patches with fewer possible side-effects (we hope).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Go to the Manage Apps page. Applications that can be installed on the SD card will indicate that when you click on them. Many cannot, but many can, including things like Angry Birds. If they can, the "Move to SD Card" button will be lit up. I have an old Android phone (Google Nexus One) with only about 192MB of RAM, so I have moved as many applications as possible to the SD card. That has left me with enough space to install applications I would otherwise be unable to.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I wrote a simple desktop interface many years ago (about 1985) using the curses api. That wasn't simple to do, but worked rather well (it became part of a commercial office automation system). You can use Qt or GTK++ to do this today, as do Gnome and KDE, but modern systems have a lot of other cruft to deal with as Mike2K indicates. To create a desktop environment in a web-based (browser) environment has no less challenges, and may be more difficult in fact. As IamThwee said, you will need html, css, and php. FWIW, php is basically C++ with HTML embedding capabilities. Both Qt and GTK++ are C++ libraries. So, in either case, you need to understand object-oriented programming and C++ just to get started.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The camera should only be enabled remotely if the student has reported the device as lost or stolen. To do so otherwise is an egregious violation of their right to privacy, and is, on the face of it, a felony. Keystroke logging? That is also a violation of privacy, but possibly not illegal, just unethical. If our school district did this to my children or grandchildren, I would have them in court so fast their heads would explode!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Write out the algorithm first in pseudo-code. If words can only contain alpha characters (no numbers, special characters, etc), then incorporate that into the pseudo-code, skipping past the next white-space character(s). Myself, I would read the file one character at a time, and use a finite-state machine algorithm to accumulate characters into a word until either a disallowed character, or whitespace (including carriage returns and linefeeds) is encountered. If whitespace is encountered, then the word is looked up in the dictionary and the instance count is incremented, or if not found, then added to the dictionary with an instance count of 1.

Once the pseudo-code is satisfactory, then you can start coding. This is a good example of why starting with code is not a good idea. It just obfuscates the issues you need to deal with.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this a home or work network? If a home network, what is your router? Have you tried other computers (or phones using WiFi) on the network?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is possible that the card has a fault. I don't know what you can do to diagnose that. You could send it in for service, but then you would be without your computer for awhile.

In the meantime, you can remove the card, clean the connectors (an eraser works well for that), and then make sure the display connector is properly seated when you reseat the video card.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are network monitoring tools that can help you do that. Two that are available (free, open source) for both Windows and Linux are Wireshark and tcpdump. They can work together if needed. IE, you can capture a bunch of network packets with tcpdump and then view them in wireshark. Anyway, you might want to check them out on the web.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

They should be. YOu need to reduce the current draw. You need to disconnect the secondary disk drives and cd drive, including the power plug. IE, shut down the system, unplug the drive(s), and then restart the system. Whether this works or not will depend upon the power draw of the CPU, which can be significant. I haven't checked, but if it is over 100W then you may still have issues when the video is operating at max.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your biggest problem in the future will be using Visual Studio. In any case, this was NOT a C++ problem. It was a Windows Visual Studio problem.