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

You should have some idea of projects that may interest you by now. Please don't ask us - there are just too many. My interests in this domain (professional) are in predicting network and systems failures by using strong engineering analytical methods on captured system performance, SNMP, and application behavioral data. Do you know what a Kalman filter is? :-)

FWIW, I am a senior engineer responsible for performance engineering on a network of thousands of servers in both the Amazon cloud and in a half-dozen data centers, world wide - serving currently 100+ million users daily. If you come up with some ideas, I'd be happy to hear them and critique them.

Here is the Wikipedia article on Kalman filters: http://en.wikipedia.org/wiki/Kalman_filter

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

Also, force use of secure http connections (using ssl - https://site/...) so the user ID and passwords, as well as returned cookies, are not "in clear" for hackers to see. Anything less, and you might as well not bother with user authentication and just let anyone in... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Normally, you initialize static class variables in a translation unit (a source file, NOT a header). IE, in pessoa2.cpp:

#include "./pessoa2.h"

string Pessoa2::strnome("ana");
.
.
.

You should NOT be initializing it in the header (class definition), although I think the latest C++ standard does allow that (not 100% sure) - most compilers will not be so current. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If this is a USB device then you may have run into the same problem that I and a number of others have in the past couple of years, especially with Windows 7 - the drivers stop operating properly. The only solution I have found is to remove ALL usb devices and hubs with the hardware manager, then reboot. The system will reinstall all the required drivers and the devices seem to work again. I have had this happen with USB drives, my USB keyboard/mouse wireless transceiver, and some other USB devices. We don't know what the root cause is, but this procedure has worked for all of us hit with this problem.

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

There are several problems with this. One is that a letter can be input in either upper or lower case. Since you are limiting input to 26 letters (the number of letters in the English alphabet), then you need to convert the letter to upper case to match your array. Second, your logic will not operate properly if the user inputs an underscore since you have already substituted the underscore for valid letters if they were previously input.

There are functions to determine if an input character is an alphabetic character. IE, your logic is simple but convoluted. So, create another character array with 26 slots, and when a valid letter is input, look in that array for the character. If it isn't found, add it to the array, otherwise emit your diagnostic message.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but I'm not familiar with this distribution. Taking a bootable USB stick is not a bad idea. It should work fine in foreign internet cafes, but until you try you won't know for sure. Before you boot the thumb drive, do check with the cafe proprietors as to whether they can let you do this. There may be local/national regulations that will put them in legal hot water.

FWIW, I have used Unetbootin generated thumb drive Linux distributions in Internet cafes in Mexico without problem - and I DID ask if it was ok to do so! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most sata/esata controllers can handle multiple devices over one connection. I do that by connecting multi-disc carriers (4 discs each) to a single port. I can configure them as JBOD (Just A Bunch of Discs), or LVM volumes, or RAID arrays. So, get a multi-disc carrier (StarTech has some good ones), plug it into the single eSata port, and enjoy your newly discovered disc capacity! All you have to do then is buy the discs... :-)

FWIW, I run Linux on my system with these arrays, but Windows should handle such devices just fine. Here is a link to their disc enclosure page: http://www.startech.com/HDD/Enclosures/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this a work computer, or a personal one?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What you call the "bios screen" is the system's POST (Power On Self Test). If you go into the BIOS (usually F2), you should be able to set the BIOS to report more details about the results of the POST activities. This should give you some data to post (sic) here that we can look at and give you some more rational advice.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@mike2k
Yeah, I break that rule all the time! :-) Hasn't bit me in the rear-end, yet... But I do understand the rationale why it is "not a good idea". Just lazy I guess! My upvote for your last post speaks for itself.

Thanks Mike. Good/great advice!

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

You probably need to remove the CPU heatsink and reapply thermal tape or paste after cleaning both the cpu and heatsink surfaces that mate to each other.

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

Conversions between types are more strict in C++ than C (the compiler errors in testprint.c), and you probably didn't "guard" your external C function declarations with extern "C" (the linker errors). So, please show your code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Huh? Convert what to sata? And what are "byous"? I know what a "bayou" is - just go to Louisiana and you'll find plenty of them (still), along with some great Cajun music and dance! :-)

Sorry, but my sarcasm gene just got control of me...

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

So, if you use WiFi you can connect, but if you use a direct ethernet connection you cannot? If that is the case, then it is likely that you need to change your TCP/IP connection settings for the direct connection to use DHCP instead of a static IP address. If it has a static address configured, it may well not be in a subnet that your router is configured to handle.

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

What if you take the battery out, and plug in the power brick?

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

The poster said "no pointers"... :-) Here is a function to do that without pointers at all.

// Recursive function to remove spaces from string
void removeSpc(char array[], size_t posn)
{
    for (size_t i = posn; array[i] != '\0'; i++)
    {
        if (array[i] == ' ')
        {
            // Move data up one character
            size_t j;
            for (j = i+1; array[j] != '\0'; j++)
            {
                array[j-1] = array[j];
            }
            array[j-1] = '\0';      // Move the terminator up one position.
            removeSpc(array, i);    // Make recursive call from current position.
            return;
        }
    }
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Two major areas of interest today (and in the future) are "network security" and "large-scale distributed systems engineering", especially in the "cloud".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Use an output statement to display the resulting sql string to the console, and then post that here so we can see what you are actually trying to store. In any case, remember that string values in SQL have to be delimited by single quotes, which you didn't do for the start of the student id value, though it was ended with one. If the id is numeric, remove the terminating single quote. IE, you have one of two errors that a cursory view shows me - one is that if the student id is a string, it isn't properly single-quote delimited, and if it is a numeric value, then it is improperly single-quote delimited at the end of the value... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Class project? Google is your friend...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this a windows system, or a linux/unix one?

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

Babble, babble, babble. Please, just tell us precisely what you are trying to accomplish! I do this stuff for a living - reading big long lines of log data, and then parsing that into stuff that we can store in a database (mysql or hadoop) and then apply analytical algorithms to them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Find another ISP without caps (or bigger ones), or get an unlimited business account - costs more, but is probably cheaper in the long run.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Has he enabled a BIOS / admin unlock password? What happens if you try to boot into the BIOS?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What file system was on the usb drive - NTFS or FAT? NTFS file systems are much more recoverable than FAT file systems. Also, in either case, if you write anything to disc, then it makes recovery a lot more problematic. FWIW, I usually use Linux tools to recover files from both Linux and Windows systems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to blacklist the source of the pings in your iptables configuration files. This will block all connection attempts by those sources. Read the iptables man pages for more information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is a tunnel, but one that allows your end-node to appear as a peer in the remote network.

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

This is where a VPN (virtual private network) is the solution. It allows one system that is geographically separate from the other group to act as though it is a local node. That's what allows me to work anywhere in the world on my corporate network just as though I was in my office.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is your wireless (WiFi) a USB device, or is it a PCI card?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you mean? What precisely do you want to do in this regard. Changing the location of the repo files is not difficult - you edit /etc/yum.repos.d/*.repo and change the location therein.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Windows assumes it owns the system. Normally, if you want to dual boot a system, you install Windows first, and then Linux. Linux will install a grub boot loader and recognize the Windows system, allowing you to boot either that or the Linux system as desired. IE, start over, and install Windows first.

FWIW, you CAN install GRUB after the fact, but you will probably spend more time and effort in retro-fitting it than reinstalling everything as mentioned above.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Like voice recognition, facial recognition is one of those so-called NP-Hard problems. IE, there are so many variables involved that you cannot state categorically that any image matches any face. You can only state a probability that an image matches a particular face. Probabilities are like statistics (and are part of statistics), and in statistics we say that "there are lies, damned lies, and then there are statistics"... Even the best facial recognition algorithms are not very good, yet. So, if you are doing a graduate-level thesis on the subject, or someone is paying you a gazillion dollars to do it, then go for it! If not, then don't waste your time.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First off, Linux doesn't accept Windows-style back-slash characters for directory delimiters in a path. On the other hand, Windows will handle Linux-style forward slashes just fine, so when referring to file paths in Java, use '/' instead of '\'. IE, use:

"c:/Users/myname/directory/filename"

instead of

c:\\Users\\myname\\directory\\filename"

The first case is universally valid. The second case is ONLY usable in Windows.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It should be noted that VPNs are also utilized for anonymizing services such as Tor.

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

FWIW, my post above is NOT performance optimized, but will handle most all situations adequately. I use such code to process 10's of thousands of log records (up to 2K in size) per second in real-time systems, and still only take 1 or 2% of a single core CPU load. This is a case where the KISS principle (Keep It Short and Simple) is a good protocol.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Myself, I would use a map to map words to occurances:

std::map<std::string,size_t> wordcount;

to store the counts of words. Simple enough. Just increment the count on each occurance.

void addWord(const std::string& word)
{
    if (wordcount.find(word) == wordcount.end())
    {
        wordcount[word] = 1;
    }
    else
    {
        wordcount[word] += 1;
    }
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please don't ask us to do your homework for you! :-(

Visual Studio C++ aside, the code will be common to all C++ compilers. Read the VS documentation and then write the code. At that point, if you have problems, we might be able to help you.

BTW, which country's peso are you referring to? Today, Mexico's peso to US dollar rate is 7.7 cents to the peso, so the math is this:

dollars = 0.077 * pesos
pesos = dollars / 0.077

Very basic math. Now, write the code to input dollars or pesos, and to convert one to the other.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you trying to understand the format of these reports so you can emulate them, or something else?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Adak
100% correct. Most of the time, you connect to the device and then send it text strings or codes to control the device. This is considered "high level" control. For low-level control, you can use direct hardware I/O instructions, which depend upon the device connectivity, such as RS-232 serial port, parallel port, USB, etc. These days, only device drivers need the low-level stuff, though "back in the day" we had to do the low-level bit twiddling ourselves... :-)

One common printer protocol that Adak did not mention is PostScript (created by Adobe and first adopted for printers by Apple), which in reality is its own high-level programming language. The original Sun workstations even used it as a display-rendering language (before X-Windows)!