DavidB 44 Junior Poster

The Sieve of Eratosthenes is popular.
You might want to start there.

DavidB 44 Junior Poster

Oh, nice.

I hadn't checked back for a while. Looks like Microsoft hasn't broken up the compiler by language this time (or am I overlooking something?). In previous versions, I just used the C++ compiler; this time it looks like you get everything--no choice.

DavidB 44 Junior Poster

You mean Visual Studio 2012? I was planning to. I recently purchased a brand new computer and was going to install the latest version of Visual C++ Express on it.

However, then I read that this version of compiler will build Metro applications only. I want to stick with Windows 7, and most of my programming is pretty traditional projects for engineering/math applications, and they are all simple console programs. For this kind of capability, a paid version of the compiler is required.

Unless I am misinformed, it looks like I will stay with Visual C++ 2010 Express for the time being.

DavidB 44 Junior Poster

It is one more site on which you can promote your business.

If your corporate profile includes the keywords that other LinkedIn users search for, your site will come up in those searches (assuming your Profile page is public).

I don't think it results in massive traffic, but it will be very targetted traffic. The fact that Linkedin is a service for professionals means most of the people there are business people. Not many students or casual users. So make sure to provide an honest listing of your services/qualifications/etc. or your company's services.

DavidB 44 Junior Poster

Depending how much information you want to transfer out of the switch statement, you might have to use several temporary variables.

For example, say the integer variable TestVar equals 6 and caused Case 3 to be true.
If you went straight to a break from there, you would know that TestVar equals 6. Not much information tranmitted out of the switch statement there.

However, if you set a few flag variables before doing the break, you could transmit more info. For example:

Case 3: flag1 = 1;
    flag2 = 2;
    flag3 = 0;
    break;

By doing this, you could break out of the switch and also provide some ways to direct how the rest of the program should execute.

For example,

if (flag1){
  proceed to take course 1
}

if (flag2 != 2){
  execute other statements
}

That is one way of doing it.
Hopefully, you get the idea.

DavidB 44 Junior Poster

Hi, Collin.

The variables *d and *e are never passed passed into the function QuadFormula.

The main program calls the subroutine, and assigns *d and *e to result1 and result2, without ever passing them in to the routine.

Also, I would recommend initializing variables before using them. That way you are always starting from a known quantity. As the programs you write get bigger and more complicated, it is better to have them initialized than have to face an "Undefined Variable" error later on.

DavidB 44 Junior Poster

I would recommend against using a switch statement in this situation.
A switch statement is meant to look at an integer value, compare it against several options, and execute simple actions based on that comparison. It should not be used to branch into compound statements. Especially not if the initial condition can only have one of two values. Why not use an if statement for the first check?

DavidB 44 Junior Poster

There is no definite time for when a site starts showing up in search results. And even if Google knows about a site, that site may show up so far down the list of results (say, page 14) that, effectively, it doesn't exist in Google's results. (I mean, does anybody go past the first few pages of results? Really?!)

Submitting a site to Bing/Yahoo! is similar to the process you used to submit your site to Google: use the submit page. Here is the direct link if you are having troubles finding it: http://www.bing.com/webmaster/SubmitSitePage.aspx

DavidB 44 Junior Poster

(This post should not be in the Internet Marketing forum, but I am willing to offer some advice.)

Is it your own website? Do you think it has been hacked? Google's diagnostics tool might turn up some problems, but it might miss others. If it really has been hacked, you might need more thorough measures to detect it and fix the problem.

In the following URL, replace example.com with the domain of the site you want to test:
www.google.com/safebrowsing/diagnostic?site=example.com

This test is pretty good. There are other, free, online test sites you could try too, if you want more than one opinion.

DavidB 44 Junior Poster

What exactly are you seeking?

A platform on which to have a blog?
"kingsweb" made a couple good suggestions. Blogger is a hosted solution that is popular. WordPress offers a hosted solution too, or many templates for self-hosted blogs. Or there is TypePad. Or many others. Some hosted blogging solutions tend to particular themes.

Or are you seeking sites on which topics related to blogging are discussed? If so, you could raise some of those questions right here on Daniweb. Or there are many forums whose main theme is the discussion of blogs, blogging, blogging technologies, etc.

DavidB 44 Junior Poster

Google+, Flickr, Pinterest, and MANY others.

DavidB 44 Junior Poster

Is your problem the algorithm? A particular part of your own code? Initially setting up the system?

If it is the C++ coding part of the task, post what you have now and we'll try to help you debug it.

DavidB 44 Junior Poster

I usually just copy from a PDF document and paste to a plaintext document.

Do you really need a program to do that?

DavidB 44 Junior Poster

The built-in help function offers a lot of information about how to use the history command too. Here is what I got when I ran the help command on history:

help history
history: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps
 arg [arg...]
    Display or manipulate the history list.

    Display the history list with line numbers, prefixing each modified
    entry with a `*'.  An argument of N lists only the last N entries.

    Options:
      -c        clear the history list by deleting all of the entries
      -d offset delete the history entry at offset OFFSET.

      -a        append history lines from this session to the history file
      -n        read all history lines not already read from the history file
      -r        read the history file and append the contents to the history
        list
      -w        write the current history to the history file
        and append them to the history list

      -p        perform history expansion on each ARG and display the result
        without storing it in the history list
      -s        append the ARGs to the history list as a single entry

#
    if $HISTFILE has a value, that is used, else ~/.bash_history.

    If the $HISTTIMEFORMAT variable is set and not null, its value is used
    as a format string for strftime(3) to print the time stamp associated
    with each displayed history entry.  No time stamps are printed otherwise.

    Exit Status:
    Returns success unless an invalid option is given or an error occurs.

And an Internet search turns up several web …

DavidB 44 Junior Poster

double is usually used for floating point variables (i.e. - they require decimal points).
The results of a factorial calculation are positive integers, so you were fine leaving it as int. To extend the range, you could use unsigned int.

Like "WaltP asked: what is the point of the variable q?

When you say it works from i = 0 to 6, do mean the values are correct? Have you confirmed that?

DavidB 44 Junior Poster

I think one way would be to just provide an example, wouldn't it? For example,

2^2 + 3^2 = 4 + 9 = 13

13 is a positive integer, so you have proved that there is a positive integer that can be expressed as the sum of the squares of positive integers.

In fact, the sum of squares of any integers (x, y, z, etc.) is always a positive integer:

x^2 + y^2 + z^2 + . . . is always going to be a positive integer.

The only way for it not to be a positive integer would be if x, y, z, etc. were non-integer numbers.

DavidB 44 Junior Poster

Do you need to save the numbers as they are entered?
If not, you only need one input variable and one sum variable.

Also, will you always take in only four variables, or an unknown number of variables?

I would do something similar to the following:

int a, isum = 0;
cout << "Enter some postive integers & I'll print the sum: ";
cin >> a;      
while ( a > 0) {
 isum += a;
 cin >> a;
 }
cout << "The sum is: " << isum << endl;
DavidB 44 Junior Poster

Some pretty good discussions occur in the Target IIT forums (but they are not extremely active): http://www.targetiit.com/discuss/

DavidB 44 Junior Poster

I am curious: besides being an interesting programming exercise, do these numbers have any practical applications? From what applications or situations do these numbers arise?

DavidB 44 Junior Poster

I don't know if you can do this, using the existing format. You could probably divide names up by line breaks, but then dividing names into first, middle, and last names would be difficult. You would have to require users to input the names in a particular format. Otherwise, the program has no way to know if a first name is, say, "Ma. Rex" or just "Ma." Or if the last name is "Cambarijan" or "III".

How is this input coming in to the program? From a textarea box? Text boxes?

DavidB 44 Junior Poster

What level of math?
I know of several forums, but their levels vary.

Are you a high school student? First-year undergraduate university student? etc.?

DavidB 44 Junior Poster

Hello, Dan.

Welcome to the DaniWeb forums. We are glad you joined us.

These forums are an excellent resource: lots of good information and many knowledgeable members here.

It is a great place for the sharing of ideas. I am sure you will learn a lot here.

See you around the forums.

DavidB 44 Junior Poster

Like WaltP already suggested, go through your code and find all the places where division occurs. I see it on lines 25 and 43. Insert a line or two before the division statements that check to see if the denominator is 0:
e.g. - if (a[i][i] == 0) printf("\nAttempted division by zero. Execution aborted.");return 0;

Or something like that. That way your program doesn't just crash.

In any case, you are not going to be able to solve this equation completely. To solve for N variables, you need N equations. You have a 3X4 matrix (I think), so you will not be able to solve uniquely for all the variables. Is your system 3X4? The a matrix is 5X5, the x vector is 3, and your comment for the data entry indicates a 3X4 system. Which is it?

DavidB 44 Junior Poster

"Chipper11", did you find the information you were seeking?

The following blog post covers directory submission--directly related to your request:

Click Here

It includes links to a couple lists of directories but, as I mentioned previously, you have to go through the lists to find ones that have the qualities you want.

DavidB 44 Junior Poster

Hello, Kareem.

Welcome to the DaniWeb forums. We are glad you joined us.

These forums are an excellent resource: lots of good information and many knowledgeable members here.

It is a great place for the sharing of ideas. I am sure you will learn a lot here.

See you around the forums.

DavidB 44 Junior Poster

I agree with what JorgeM said: get good at HTML and CSS before moving on to other things.

Then maybe Javascript or PHP. Depends on your own goals. Do you have a specific plan in mind for your website? Perhaps you already have a few functionalities in mind (?).

I'd also recommend learning a graphics software like Photoshop, or GIMP. One of my own weaknesses is graphics; whenever I need an image created, I always have to ask a friend or co-worker. If you ever want to get paid as a web developer, you will need to do your own graphics work.

DavidB 44 Junior Poster

I don't think there is a ready-made list that contains directories with those qualities.
There are many lists, but you have to go through them and visit each directory one-at-a-time to see if submissions require a reciprocal link.

A few other factors to keep in mind:

1) There is no way to tell ahead of time if approval is quick. All you can do is submit and find out for yourself.

2) Conditions change all the time. A directory that is free today may not be free next week. The same can be said for the speed of approvals. The administrator may approve submissions quickly one week and then get slammed with a deluge of submissions the next week, so the approval process is much slower.

3) Any directory with decent PageRank probably won't be free. It will either require payment or a reciprocal link. If you want to make free submissions, you are restricted to relatively new and/or low-quality directories with no or low PageRank.

DavidB 44 Junior Poster

Visual C++ is also a good alternative but I couldnt find any command for compiling and running the code.

It is there. If it wasn't, I doubt VC++ would be used much.

In addition to going through the menus, you can also do it with hotkeys. For example, to execute I think you can use F5 or Control-F5. Microsoft has posted several handy posters for keyboard shortcuts on their website:

http://www.microsoft.com/en-us/download/details.aspx?id=13189

For VC++ keyboard shortcuts, the two PDFs you are interested in are the two with CPP in their title. Just download, print, and you've got yourself a handy reference.

DavidB 44 Junior Poster

Digg and Delicious used to be two of my favorite sites; I would visit them daily.
However, Delicious is making some significant changes lately.
I found some of my favorite links from the Delicious front page; however, presently the Delicious front page has a couple images, which don't appear to be hyperlinked, and the most popular bookmarked sites are no longer presented in nice categories.

It may still be a handy service for bookmarking my own sites but, as a service for learning about newly popular sites, it is really losing its appeal.

What is going on at Delicious?

DavidB 44 Junior Poster

Hello, Andrei.

Welcome to the DaniWeb forums. We are glad you joined us.

These forums are an excellent resource: lots of good information and many knowledgeable members here.

It is a great place for the sharing of ideas. I am sure you will learn a lot here.

See you around the forums.

DavidB 44 Junior Poster

The latest NASA rover to be sent to Mars, Curiosity, successfuly landed on Mars late yesterday evening.
I think this is wonderful.

Anybody else in Daniweb following the progress of this mission?

DavidB 44 Junior Poster

Hi, I am wondering if there is a way to include subscripts or superscripts in Daniweb?

I just answered a question about polynomials and it would have been nice to have more math symbols available to discuss math-related topics when they come up.

For example, instead of writing a polynomial as follows:

a0*x^0 + a1*x^1 + a2*x^2 + a3*x^3 + . . .

it would have been nice to write it with the proper subscripts and superscripts. I tried to use HTML code (<sub> and <sup>), but that didn't work. Am I overlooking something?

Also, another bit of annoying behaviour: when the line above is not wrapped in code tags, the '*' sign is removed and the characters are pushed together. For example, a2*x^2 becomes a2x^2 when the post is actually posted. Is there a way to stop this behaviour?

DavidB 44 Junior Poster

You are in the Javascript forum, but the title of your post refers to Java. Which language are you using, Javascript or Java?

In what format is the data? Is the data already saved in a string? An array?
Are the values always integer? Or will they be float? Double?

DavidB 44 Junior Poster

I think "m4ster_r0shi" gave the best answer in his first post.

There is no guarantee that the results will be nice, round, numbers. Even if the square root function were to return a whole number, the next step is to subtract it from (-b) and then divide that result by (2a). Again, there is a good chance the result will be a decimal.

Other than compute the discriminant (b * b - 4 * a * c), this program does really little to forward you to the solutions of a quadratic equation.

DavidB 44 Junior Poster

(Assuming you are dealing just with polynomial functions)

A couple suggestions.

C++ array indexing starts at 0.
From line 49, you have input the coefficients of the polynomial starting at polynomial[1], and then a few lines down you assign the constant term to a separate variable, constant.
Why not just assign it to polynomial[0].
Then you'd have all the coefficients in a single array and everything later could be dealt with more smoothly:

a0 * x^0 + a1 * x^1 + a2 * x^2 + a3 * x^3 + . . .

Then,
polynomial[0] = a0, which is the constant,
polynomial[1] = a1,
polynomial[2] = a2,
polynomial[3] = a3,
. . .

And you know that the array index corresponds to the power of x for a particular term (e.g. - polynomial[2] corresponds to the term for which the power of x is 2, etc.).
Having this connection makes things a lot easier.

In Newtonf, you define b twice, as a double, and in the loop as an array index. You should only need it once. You define c but don't use it.

In Newtonfd, you define c, and use it, but don't initialize it.

And you don't pass 'x' into either function. You need to pass in the x-point at which you want each function to be evaluated.

You know the derivatives of a polynomial are simply n * an * x^(n-1), where n is the power of the term.

DavidB 44 Junior Poster

What's wrong with a well-known product like vBulletin (or inVision's IP.Board)? The fact that they are well-known means visitors don't have to re-learn features and capabilities. I'd recommend using vBulletin for a new forum. That way you can focus on building up your website, and traffic, instead of also having to program a forum with a new--and possibly flaky--software. It would be just another unknown to deal with at a time you cannot afford to spend time on it.

DavidB 44 Junior Poster

This question would have been more appropriate in the "Software Development"->"Computer Science" section of these forums.

What, exactly, don't you get? The algorithm itself? The C++ coding part of the problem? . . .

Why don't you post what you have done so far, and we'll try to help you from there.

DavidB 44 Junior Poster

As others have said, it depends upon your application.

For most standard software applications, Windows offers the most options, although you could probably find comparable applications for Linux. It would be a little harder though. The difference would be the price: most software packages for Windows are commercial for-sale products, whereas most Linux products are free.

The one factor for which Linux beats Windows is the real-time capability.
Windows--I think--by definition prevents users from directly accessing the operating system. The delay introduced by this interface means it is not useful for any application requiring real-time interaction. So, if your application involves programming for robotics, telephony, communication, etc. --anything for which you want interaction to be as close to real-time as possible, you really have no choice but to use Linux (or Unix).

DavidB 44 Junior Poster

Hello, "adylo".

Welcome to the DaniWeb forums. We are glad you joined us.

These forums are an excellent resource: lots of good information and many knowledgeable members here.

It is a great place for the sharing of ideas. I am sure you will learn a lot here.

See you around the forums.

DavidB 44 Junior Poster

Have you tried to write this function? Post what you have so far, and we'll try to help you with it.

If you find a duplicate entry, and you remove it, what replaces it?

DavidB 44 Junior Poster

I am putting together a wish list for a new computer.
I would like it to be dual-boot: Windows 7 and Linux (probably Ubuntu because I am not proficient with Linux).

Any advice, tips, or suggestions for factors I should take into consideration when selecting a new computer?
Does type of formatting matter (NTFS or not)?
Any suggestion as to what proportion should be set for each side of the computer (e.g. - 50% Windows, 50% Linux)?

Any recommendations?

DavidB 44 Junior Poster

Anybody else excited about this?

Not excited, my nose is too close to the grindstone right now to look up and pay attention to the greater world at large, but I do have an interest in scientific developments. Until it affects my day-to-day life, I don't know what to make of it.

It is as if we discovered intelligent life on a faraway planet but had no way to interact with those life forms. So what? We would have no knowledge exchange, no shared development, no boost to technology, no learning of political structure, etc.

Will it yield alternate energy sources for industry? Better structures? We don't know. I doubt its impact will be felt in my lifetime.

DavidB 44 Junior Poster

I had posted a photo of myself (jpg) on a Wiki (uses MediaWiki) and updated it recently. Now I am wondering how to delete the old photo. The link to the image has been deleted, but the image itself is still there, taking up space on the server. I didn't see an option to delete the file.

How can I delete the image from the Wiki?

DavidB 44 Junior Poster

Hello, "Campus Report".

Welcome to the DaniWeb forums. We are glad you joined us.

These forums are an excellent resource: lots of good information and many knowledgeable members here.

It is a great place for the sharing of ideas. I am sure you will learn a lot here.

See you around the forums.

DavidB 44 Junior Poster

I have recently gotten more involved in the logistics side of my employer’s activities and we use SAP for a large part of our CMS work (specifically, SAP by Design).

We have hundreds of Sales Orders (SOs) in the system and they are spread out to 2016.
I am now trying to find a way to track each order over its lifetime without having to baby-sit each one.

For example, say a customer order is planned for delivery/installation around the week of May 16, 2014.
I would like to configure reminders or alerts so that each step along the way does not get forgotten:

July 9, 2012: Customer contract has been signed, so enter SO into SAP.  Do not yet submit it for further processing.
January 15, 2014: Contact customer to do a site survey. Require all options to be configured, as well as additional accessories that may be desired.
February 1, 2014: Submit SO in SAP so that it progresses to order processing. Hardware needs to be prepared, as well as all the options, and software for the customer’s unique configuration needs to be prepared and installed.
May 1, 2014: Items for SO need to be prepared for shipping to customer site.
May 1, 2014: Confirm that customer AND installer will be on-site within a couple days of shipment delivery so that installation can proceed. 
May 2, 2014: Products for SO to be shipped to customer site. Allow two days for FedEx delivery within US.
May …
DavidB 44 Junior Poster

I am no Linux expert, but you could use a few options to shut it down or hibernate: shutdown, reboot, hibernate, sleep, . . . It is pretty easy to specify a particular time for the machine to shut down or go to sleep.

However, waking it up is another matter.
Once the machine is shut down, you can not access it from the console; you have no choice but to walk over to it and turn it back on.
Alternately, if you have set it to re-boot at a certain time, again, you don't have a chance to change that randomly.
Same for sleep. You can put the machine to sleep for a certain amount of time (say, 4 hours), but once that command has been set, I don't know if you can then wake it back up randomly (if you need it back on after 30 minutes).

DavidB 44 Junior Poster

but openoffice is not fully compatible with microsoft office in terms of file format as microsoft word 2010 doesn't open .odf 2.1/more

You dug up a thread from eight years ago?!! Times have changed since then.

In fact, the last I heard, development of OpenOffice has ground to a halt. LibreOffice is now the one to use.

DavidB 44 Junior Poster

Do you have an existing system using SharePoint? I know it is popular with some of the local school boards in my community--but in this case, they are connecting schools physically spread around the city.

If you do not have an existing SharePoint system, and all your users are in the same building on the same LAN, perhaps a Wkii would be applicable. There are some free Wiki packages available, offering varying capabilities. Perhaps one would suffice for your purposes. In fact, my employer uses a Wiki, and everybody in the offices edits their own entry in the company employee directory, has access to forms, Word documents, edits "How-to" pages, tracks software bugs, etc. And for the odd time an employee has to work from a remote location, they just VPN into the network, and they have access to the system as if they were working in the office.

DavidB 44 Junior Poster

Hmmnnn . . .

No restrictions as to whether the code is old or new?

Looks like an opportunity to dig up some old code and share it. It is well-tested and I know it works, but it is pretty specialized, so might not have broad appeal. (Can you guess what kinds of programs I write? See my sig for a hint.)

Are those gift certificates valid on amazon.ca? (Are you willing to barter? I'd go for an AdWords credit or something similar: Facebook PPC credits, etc.)

DavidB 44 Junior Poster

There are lots of other sites like this too, right? Is it similar to Amazon Mechanical Turk or more involved projects?

In addition to odesk, off the top of my head, I can think of two similar sites: Elance and HiretheWorld
They are freelance sites.

A search for freelance sites would probably turn up many more similar services.

And, no, you do not have to be a programmer. You can write articles, make comments on blogs, conduct surveys, write reviews, create graphics, etc.--whatever services people are looking for. The pay is not that great, since you are bidding against people from all over the world on small jobs, but it can add up.