rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Close, but no banana. You need to store the letters in a char array, and the count should not be subtracted by 1 at the end. IE:

#include <iostream>
#include <stdio.h>
#define MAXLETTERS 100;
using namespace std;
int main(int argc, char* argv[])
{
    char letters[MAXLETTERS+1];
    char letter = 0;
    int count = 0;
    double ppl = 0;
    char done;
    double finalCost = ppl * (count - 1);
    cout << "\tWelcome to My Price Per Letter Calculator!\n";
    cout << " What is your next character? Type '*' to end : ";
    do
    {
        cout << " What is your next character? Type '*' to end : " << flush;
        letter = fgetc(stdin);
        if (letter != '*')
        {
            letters[count] = letter;
            count++;
        }
    }
    while (letter != '*' && count < MAXLETTERS);
    letter[count] = 0; // Terminate the string.
    cout << " What is the price per letter to pay? ";
    cin >> ppl;
    cout << " You have "<< dec << count << " letters at $"<< ppl
         << " per letter, and your total cost is $" << finalCost << "."
         << endl;
    cout << "Press any key to finish: " << flush;
    fgetc(stdin);
    return 0;
}

Note the combination of C and C++ i/o functions. This is a case where C functions are sometimes simpler to use than C++, yet can be used interleaved as shown. Exercise for you - convert the fgetc() function calls to C++ ones that will return after getting one character... :-) In …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@cmps - yes Adobe tools are great, but they are REALLY expensive. FOSS tools such as cinelerra are almost as capable (and sometimes more so), yet free. IMO, you can't beat the price! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The "warranty center" owes you two things: one is a new set of Windows restore discs. The other is to install the restore partition as per OEM requirements. If they will not do so, then file a formal complaint with Toshiba and your state attorney general.

JorgeM commented: great advice that lead to a good solution! +12
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, basically you are writing your own web browser - good luck! Not impossible, but not trivial (to say the least). You will have to be able to parse the returned HTML text and render it in some sort of reasonable way. FWIW, my company does this, and we utilize Mozilla (Firefox) code instead of rolling our own - and we are a multi-billion $ company... And we DO contribute back into the open-source community changes we make. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Or:

    #include <iostream>
    #include <string>
    using namespace std ;
    double get_double(string Prompt)
    {
        double salary ;
        cout << Prompt << flush; 
        cin >> salary ;
        return salary ;
    }
    void main()
    {
        double salary = get_double("Please enter your salary $") ;
            double perc_raise = get_double("What percentage raise would you like? ") ;
                double new_salary = salary * (perc_raise / 100) + salary ;
                    cout << "If I give you that much of a raise you would be making $ " << new_salary 
                          << ".\nYou better be worth it \n" ; 
            system("PAUSE") ;
    }

If you don't include the flush io manipulator, then the system may, or may not display the prompt output. The endl manipulator will also flush the output buffer, but you may not want a new-line in the output.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Each return point returns only one value, true or false. Assuming your logic is valid, you are ok. FWIW, I am NOT going to review all 250 lines of your code to determine if your predicate logic is valid! :-)

So, which branch is returning "128" instead of 0 or 1?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, I agree with Rev.Jim. Software won't do much (or anything) to fix these issues. FYI - I am a senior systems/performance engineer with a tier-one mobile phone company and work with this stuff for a living. I also used to teach AT&T techs the fundamentals of wireless tech classes, including WiFi, cell, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are several grades/speeds of WiFi - a/b/g/n. The fastest is 'n'. Check if your computer AND access point (router) are both using that. Also, the distance from the access point (AP) to the computer affects speed tremendously. There are high-gain antennas (if your AP has an external antenna/antennas) that can improve that factor. Also, the communication channel that your AP uses can be important. If there are other WiFi AP's in your area that use the same channel (default == 6), then that will also affect your available bandwidth - set it to a channel that is not being used by others in the area.

A final note - if your AP is physically distant from your computer (such as at the other end of the house and on another floor), then you might consider getting a WiFi repeater - effectively an AP that re-broadcasts the signal from the router to your computer, and from your computer to the router.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Remember, winsock is Windows specific. Better to use standard C socket library stuff, which Windows also supports, as do Unix/Linux systems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Use pseudo-code to describe the steps you need to take to accomplish your end. Then, use that to write the code. Don't ask us to solve your homework problems for you. We will help you when you run into a problem you cannot solve, but YOU have to make the effort!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Run Linux in a virtual machine on your Windows system and install nasm. From the nasm man page: nasm - the Netwide Assembler, a portable 80x86 assembler

You can download/install the VirtualBox virtual machine manager, and then install any number of Linux distributions on that. Each virtual machine will be a virtual x86 computer, so you can learn the do assembler programming to your heart's content, and not mung your host system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is the recording, and there is the mixing/cutting. Recording is easy. Mixing/cutting is harder. There are a number of great tools available. Unfortunately, most of the Windows ones are commercial applications. Linux has a number of great free/open-source (professional quality) tools for that, such as cinelerra, kdenlive, etc. Here is a link to the cinelerra web site for live cd images that you can use to check out the tool without modifying your computer: http://cinelerra.org/getting_cinelerra.php

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Lock the data? You can us full-disc encryption tools such as bitlocker, pgp, etc. They are quite secure and will keep your data from prying eyes if they don't have the decryption key.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, check that height is != 0.0, otherwise you will get a floating point exception and your program will dump core.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If someone has physical access to your network, they own you! They can attach a network sniffer and obtain credentials, passwords, and monitor/manipulate traffic to their heart's content. Logical security keeps people honest and out of things they should not be accessing without appropriate permissions.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ah! The black boxes of compilers and optimizers! In theory, the inner loop is executed 100K times, in either case. How the compiler performs loop optimizations is the biggest issue here. In theory, the one where the outer loop is only executed 100 times should be faster (fewer initializations of the inner loop), but as nitin1 indicated, the first one was actually faster. I stand by my contention that it was a compiler optimization side-effect, and the only way to tell if one is faster than the other is to disable all optimizations. I suspect that they should, in such a case, run identically! Or close enough over a number of runs to be such... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is how compliant C compilers interpret backslash (escaped) characters in a string. Let's look at your printf string from a stringent C/C++ perspective: "\nab\bcd\ref"

The "\n" should be translated to a new-line (CR/LF on Windows, and LF on Unix/Linux). This should drop the cursor down one line, to the beginning of the next line. The "\b" should be a back-space, and "\r" would be a carriage-return (go to beginning of the line). These are non-printing characters, but manipulate the cursor position.

So, strictly speaking, this string should display as "ef" with a blank line before. Why? First new-line drops cursor one line down on display. Then it prints "ab", then it backspaces over the "b", continuing to print "cd", then it goes back to the beginning of the line with the "\r" erasing the output, and prints "ef". So, assuming that the "\b" is actually a backspace, then the output should be a blank line followed by "ef".

IE, nether of these examples you provided are C-standard compliant! Unfortunately, Microsoft has its own idea of "standards compliance"... This is why, when we want to put directory paths in C/C++ strings, we use forward slashes - no improper interpretation will happen, and MS compilers will handle the forward slash directory separators correctly, even though it uses back-slashes itself for such separators. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is a huge body of work in the AI field. Do some Google searches on Artificial Intelligence, Fuzzy Logic, Neuro-computing, and Genetic Algorithms. I have a couple of linear feet of such tomes on my book shelf. The fuzzy logic and genetic algorithm books have been the most useful for me.

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

Here is a good description of the issue: http://www.cplusplus.com/forum/articles/416/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A p2p network can also have client/server connections. Consider these terms as abstractions. In a P2P network, one system is directly connected to another, as peers (ie, peer-to-peer); however, once system on one end of the p2p network may operate as a server that a client on either end can access. The connection is still p2p, but the protocols are client-server. Confused yet? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How is this connected to the system - sata, usb, ide?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, there are "infinite" precision math libraries (I think Boost has such) that you could look at for ideas... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The sauce probably got into the system, shorting out the interface to the pad. You need to take the case apart and clean it up thoroughly.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Don't ask us to do your homework! That said (and often before), do some research on in-fix, post-fix parsers. Do you want it to handle RPN (Reverse Polish Notation) expressions, or normal in-fix notation? If you can't answer that question, then you REALLY are behind the 8-ball!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Make fewer laws.
  2. Fishkill is a town in New York state. There is no solution!
  3. Better marketing.

IT solutions? Who the heck IS your professor/advisor? These are (in my opinion) totally bogus! I'm sure you can come up with some IT approaches to these problems, but why?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Agreeing with ddanbe 100%... If you have no clue now as to what you are interested in with regard to this field of study, then you should change your focus to something like marketing...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Call a web page? Do you mean render it as in a browser? Or do you mean to download it to your system? There are a number of commands to do the latter, such as the wget command: wget page-address

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Mostly crescendo is correct. To me, these terms are only relevant to the definitions of "hard" vs. "soft" computing that are in use by the propagator of the question. IE, you mean apple, and I mean orange when referring to fruit...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Try running Linux in graphic (GUI) mode. If it still does not freeze, then it is probably a Windows driver problem. If so, then see if there are driver updates to install by going to the hardware vendor website support page for this device.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Along the lines of what JorgeM said. I used to do such work a long time ago, and still do occasionally on a consulting basis. I document the equipment, software, configurations, router settings, and run a network mapping program to map the lan and the connections between systems (netmap). FWIW, get a laptop with Linux installed on it with all the network software tools you need installed. This is NOT a task that you want a Windows laptop for! Also, depending upon the number of nodes on the LAN, you will probably want to see what shares are active on the network.

As for the WAN part, document ALL router/firewall settings COMPLETELY! Since these will be for schools, you will also want to document the web filters in place.

Final advice: practice on your office LAN (at least for the network assessment stuff) until you are comfortable running the tools and work out the methods you need for the task. And DOCUMENT those methods as well! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Your last comment about the fact that the "mapping" can change between boots, and that the on-screen keyboard also is fubar, is telling. To me that means it is most likely that the system keyboard controller is bad. I think it needs to be sent in for repair. Both the physical and on-screen keyboards send scan codes to the controller, which in turn talks to the operating system. One final test to determine this is to boot a Linux live cd/dvd disc and see if it is also mucked up. If so, it is a hardware problem with (most likely) the keyboard controller. If not, then... I am clueless! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Does it only freeze when running Windows, or also when running your Linux live cd?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The difference in the immortal words of The Bard (Shakespeare) is "It depends". I consider phones to be the primary "mobile" platform of the day, though tablets and such are gaining traction in the mobile domain. Most phones and tablets utilize ARM processors, whereas desktops (including desktop replacement laptops) utilize Intel processors. Oracle has just announced that they are developing an ARM optimized JVM for mobile use. What they do to optimize it is still up for grabs. In any case, if you are developing an application for both mobile and desktop use, you may not do much different. In fact, theory has it that you really don't need to do anything. Experience has taught me that is not the case, however; although the manual optimizations you do to enhance performance and user experience for mobile devices will also apply to desktop versions as well.

Sorry, but that is about as specific as I can get without specifics from you on what you are trying to accomplish.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Many of the issues involve garbage collection, and its impact upon performance. There are techniques (too involved to get into here) that can be used to improve its efficiency. In fact, there are real-time java virtual machines that use reference-counting GC's vs. the default mark-and-sweep variety; however, most mobile devices use standard JVM's. As a result, this can become an issue unless you employ such techniques as pre-allocating data buffers, store them in pools, and use those for application objects as necessary, reducing the amount of GC required at run time. These techniques are generally NOT taught in most Java programming courses. C++ has similar issues, and so some classes (such as string classes) will implement their own allocators and assign pre-allocated buffers from a pool to class instances as necessary, and return those buffers back to to the pool when they are no longer needed. FWIW, string classes in both Java and C++ often use reference-counting to determine when to delete the underlying string buffer, and copy-on-write (COW) algorithms to determine if a buffer needs to be physically, vs just the pointer being assigned to a new object.

FYI, I own both the first and second editions of the JVM specification books (and have studied both to a great extent), and have done extensive research into garbage-collection algorithms, having implemented a C++ reference counting GC that has allowed major manufacturing systems comprised of 10M+ lines of C++ code to operate without memory leaks and NO application-level delete calls whatsoever. …

frankenfrank commented: interesting and useful post +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You just want to chart securities market moves during the day? Look into charting tools such as GNUplot. That would work very well, and you can tie it to a browser window using JavaScript very easily.

In case you are insterested, I spent at different times about 4 years doing serious stock/options software development for index fund management and then options risk analysis and hedging tools. I worked both as a consultant for the Mellon Bank and as principal developer for a company associated with the Chicago Board Options Exchange (CBOE). I know something of the subject if this is what you mean.

In any case, if you just want to display intraday plots of securities, then I do advise the browser->javascript->gnuplot approach. Most of the "heavy lifting" is already done, and you will mostly need just to periodically push the new data points into gnuplot and then display the graph using javascript.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In my opinion, this is a domain that has a new "cure" every other week! Personnaly, I don't GAS (Give A Sh!t) as long as it stays out of my way, lets me configure it to my needs, and works without my thinking about it. Most current GUIs are useless in these regards in my opinion... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To both arpha16 and exsoft: we don't do people's homework here. If they post their best effort code and describe where they are having problems, we might help them. However, the terms of service for this forum is that we DO NOT do your homework for you! So exsoft, please don't do this in future! :-)

Ok, dope-slap over - you (exsoft) gave a good hint that arpha16 should take from here, though it REALLY isn't pseudo code. That would be more on the order of:

while password is not correct
    print "too bad, you lose!"
else
    print "ok, you win!"
end while

IE, pseudo code is JUST a description of the steps to take to solve the problem. Your code is way too close to correct C++ source code (with some issues - not to discuss here).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Look up "pointer to member".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Frank, from what I (and others) have observed, you are obviously trying to help newbie C++ programmers with common patterns. Unfortunately, as folks such as decepticon and labdabeta have indicated, you may be causing more problems than you are curing.

I applaud your efforts, but I encourage you to get more experience before you share your "enlightenment" with the rest of the world... :-)

FWIW, I have been designing and developing major system software with C++ since 1992, and today write complex data collection and analytical software in C++ as senior systems engineer for a tier-one mobile phone company. I do know a bit about the subject of C++ design and development. I have also taught the subject at the senior and graduate level, though not since the early 2000's.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Java is Java. Mobile, PC, server - it is all pretty much the same code. Android uses a version of Java called Dalvik - it is Java code, but with a different compiler and byte-code interpreter (virtual machine). That said, how you approach application development in each such environment is very different. Mobile devices are much more resource constrained (memory, CPU, storage, etc). You need to be more aware of these issues and operate accordingly. I am a senior engineer for a major mobile phone manufacturer and we write Java code for all the above. Some phones (of the "smart" variety) are pretty well endowed with CPU and RAM, but a lot that we sell are not so (so-called "feature" phones). We write software that has to run on all of our devices, and that is a definite challenge!

These days, most mobile applications that 3rd parties sell are what we call "webapps", using the WebApp API's. That helps insulate them from such issues for the most part. In our case, those applications actually run on our server farms (thousands of high-end Linux servers running all over the world), and only the UI runs on the phone (input and output). Even the rendering of the display occurs on our servers, and only the input/output are handled by the phone. This is becoming more and more a common pattern for mobile phone applications. Tablets are more capable, so this is less an issue for them. In any case, because the actual …

frankenfrank commented: thank you for teaching me this +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Jony, it seems that you keep asking us to solve your homework problems for you. We don't do that! Make an honest effort. Post your OWN code. Tell us where you are having difficulties with it. And THEN we might decide to help you. Unfortunately, you have not got off to a good start here with regard to "honest effort"... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We don't do your homework for you, which is what (in not so many words) Moschops was saying. Make an effort. Post your code. And if it is reasonable, we might decide to help you - though you haven't got off to a good start here...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

MPI - Message Passing Interface. The link that AD provided is very good. The US national laboratories publish a lot of computer science stuff that is extremely useful. I like the CS pages of Oakridge National Lab (http://www.phy.ornl.gov/csep/) myself (great stuff on semi-numerical algorithms, random numbers, Monte Carlo routines, Finite Element Math, etc). MPI is used to help enable large-scale distributed computing. It supports distributing otherwise long-running computations over many systems. This is essential for modern physics research when they have to run the same computation against a gazillion (technical term for "a really large number") particles and observed interactions. FWIW, my wife is a particle physicist involved in computational physics at Fermi National Laboratory in Batavia, Illinois. She knows this stuff like nobody's business! Me? I can use it (I do large-scale distributed computing also), but it isn't essential for my work. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

AFAIK, there is no such, unless there is something that is integrated with a computer and signal capture device that can accurately measure the signal strength at any point relative to the AP. Then, you would need to thoroughly traverse the entire 360 degree range around the AP at various distances in order to map it (both horizontally and vertically). Each type of antenna and AP will generate different profiles in this, so in theory there is no tool that can do that automatically. You might find something that can extrapolate the map from a limited number of data points, but not accurately (especially considering issues of phase-interference, interference from other RF signals in the same frequency range, etc), in my opinion. If you want a more expert opinion (I am an EE and member of the IEEE and am a senior systems engineer for a major mobile phone manufacturer), I can ask some of my colleagues in the IEEE who are consumate experts in radio propagation and antenna design, but I suspect they would agree with me. I once took a class in genetic algorithms from an engineer who designed antennas for phased-array radar systems for the US Air Force. We used to discuss these issues. The math alone is daunting!

Back to the original question, regarding whether there is a Linux tool that can draw such a map (from a myriad of sample points) - possibly. Unfortunately, I don't know what it would be.

Which brings us to …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My advice? Go for what gets your juices flowing! That can make a career. Anything else is just a job! Find that niche and get good at it. Get so good, that anyone who needs someone who is an expert in that subject will naturally gravitate toward you to help them solve their problems. However, to do that, you need to network with peers, publish, connect with others, join and become active in the appropriate professional organizations, etc. FWIW, certs are pretty low on my list of things to do. The fact that I wrote a chapter for a major graduate-level text book in my field is held in much higher esteem than some vendor-sponsored certificate of i-dotting and t-crossing...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Pr0n and such are NOT the only source of viruses. These days, a lot of major web sites are from time to time infected with so-called "drive by" viruses - embedded in altered java script and other web pages. My approach is this:

  1. Use a good virus scanner.
  2. Use a web browser other than Internet Explorer, such as Mozilla (Firefox) or Chrome.
  3. Disable java script and java applets/plug-ins for the browser, or at least require your permission to run them.
  4. Don't visit web sites you don't trust.
  5. Review your email. Anything with a link should be checked with your A/V scanner.
  6. With a clean system, make regular system image backups to an external drive of the ENTIRE disc - some viruses will infect the boot loader and files in your recovery partition. Use a live Linux CD or DVD to do this. I can provide detailed instructions how to do that if you wish.
  7. Scan the system on a regular basis.
  8. After scanning, backup your data files to an external drive.
  9. Use Linux - it is a lot harder to infect than Windows (just my opinion, and a shameless plug for Linux).
  10. Make sure that the external backup drive is kept detached from the system except when either backing stuff up, or restoring the system.

If you do get infected, don't just attach the backup drive to restore the system. Do this:

  1. Boot with the live Linux CD/DVD that you used to backup the system drive.
  2. Restore the backup …
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Basic math (including algebra) is critical for any science or engineering/computer-oriented career. I won't hire staff that doesn't have at least a good foundation up to a mid-level algebra, even for low-level positions. Even if you find it difficult, if you are motivated, you will find the resources that will help you though the hard parts, and once you start to "get it", it will become a LOT easier.

One other thing, a course in formal logic would not be remiss either. In my career as a software engineer, that one course has helped me more than all the calculus and such that I ever took! If computers are nothing else, they are totally based upon logic...

In any case, an Associates degree in applied science implies, to me at least, that you have basic math and science skills and training. Math is the foundation of ALL science. More is definitely better in this case!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can install and configure a small Linux box as a firewall and blacklist filter. It will be considerably less expensive, both from the hardware and software perspective, than installing a Windows server to do this. There are also dedicated boxes, most of which internally run Linux. Try some Google searches. When you find something that interests you, post what you find here and we can look further for you (capabilities vs. cost vs. company reputation, etc).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to look that up with Steam for this game, or it may be configurable so you can set the port yourself, and then forward that. If the game only needs one outside-visible port, then the start-end points would be that one port. If the game can take both TCP and UDP connections, then depending upon the router, you may have to enable those separately, but using the same port.