English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Programming & Design - November 2007

[Selected]: All categories Computers & Internet Programming & Design

Novice c++ guy here, trying to wrap my head around arrays and functions. This is supposed to be a program that takes the center and radii from 2 3d spheres and determines if they collide.

#include
#include
#include
using namespace std;

struct sphere
{
float center[3];
float radius;
};

bool sphereDist (sphere &s1, sphere &s2)
{
return (pow(s2.center[0] - s1.center[0], 2) +
pow(s2.center[1] - s1.center[1], 2) +
pow(s2.center[2] - s1.center[2], 2)) <
(s1.radius + s2.radius);


}



void main ()
{
cout <<"Sphere collision detection program, by D.R."<< endl;
cout <<"Input the centers of sphere one"<< endl;
cin>>s1.center;
cout <<"input the radius of sphere one"<< endl;
cin>>s1.radius;
cout <<"Now input the centers of sphere two"<< endl;
cin>>s2.center;
cout <<"Please input the radius of sphere two"<< endl;
cin>>s2.radius;

if (sphereDist == true)
{
cout <<"The spheres collide." << endl;
}
else
{
cout << "the spheres do not collide." < }

2007-11-29 17:03:23 · 2 answers · asked by dustin_r_85 1

A program I wrote in c++ to store contact information to a text file only works correctly the first time through. The second time I try to run the file, I can only type in the file name and then hit [enter]. but nothing happens.
please help

2007-11-29 14:38:31 · 2 answers · asked by eman m 2

I am making an HTML website. When i put up a picture, the picture doesn't show only, a white box with the red x appears. How can I change that?? I've alredy tried to go on "tools, Advanced, and Check off the box that says Show Pictures. And it is on. But what else can be the problem? Please tell me!! I want to make this website!?! I will pick a best answer, (only if it works.) PLZ help By today!! <33 Thanks Bellaaaaa

2007-11-29 11:47:31 · 7 answers · asked by bellaa3x ♥ <33 1

how do i make a website with
yahoo geoctires???

and upload piktures to it
and all that jazz

2007-11-29 11:07:25 · 1 answers · asked by rock it 2

2007-11-29 08:15:25 · 3 answers · asked by Anonymous

I am building an html email and I am finished with what I wanted to do but I have a large white space underneath my design and I can't get rid of it.

Please tell me what is causing that space and how to get rid of it.

My goal here is to get rid of the white space, not to redesign the page to make it more compliant, try different css tricks or get the page to work better on firefox or google mail etc. I am only interested in the white space fix.

http://www.geolearning.com/email/saastest03.htm

2007-11-29 06:22:47 · 6 answers · asked by Anonymous

How do i fix it?

2007-11-29 06:22:35 · 1 answers · asked by nickcarswell1 1

2007-11-29 05:27:29 · 8 answers · asked by Anonymous

seems like proxy sites are all blocked.
i used dontlistentoteacher.info
for a while but now its blocked.
please help.

2007-11-29 05:18:19 · 15 answers · asked by Anonymous

I am using dreamweaver to create some pages and it seems that some pages are .html and some are .htm.

Please explain if there are any differences, how they matter and how to specifiy dreamweaver which type of file to save the page as.

2007-11-29 05:14:36 · 7 answers · asked by Anonymous

2007-11-29 04:30:17 · 4 answers · asked by katy 1

I have spent the last two days trying to get a 16 X 16 icon to appear in IE. I placed the .ico file in the root folder of my site and it appears in Firefox but nada in IE. My boss needs this for a client and thinks I can find out how to do it for IE. HELP!!!

2007-11-29 04:14:04 · 2 answers · asked by Anonymous

Can someone look at this code and tell me what it is supposed to do?
for(row=row_index-1; row<=row_index+1; row++)
for(col=col_index-1; col<=col_index+1; col++)

This was the code that was provided to find the number of neighbors of each cell.

2007-11-29 04:13:26 · 2 answers · asked by Smokey. 6

i want to know about HTML and WYSIWYG, i want to know the differences and the similaritys between WYSIWYG and HTML ? which text editor would you recommend me for my website?

2007-11-29 03:42:36 · 5 answers · asked by Anonymous

I am developing specifications for a client web site. The site will not change very often, however I'd like the ability to modify one or two pages at random. Do I need to worry about what language the site is programmed in? I realize there are a number of new languages, techniques etc. I am wonder how transparent that needs to be for me. I do not have programming or design skills.

2007-11-29 03:36:49 · 2 answers · asked by Avery G 2

I am trying to call an alert which works fine, but I want it to show an alert if an age is higher than 30 or lower than 30, and show the age entered in the form, can this be done?

I have the follwing code i have done:
/calling yourdetails function to show details
if($details->Yourdetails($_POST['age'])){
$msg='blah, blah, blah.';
}
else
{
$msg=''blah, blah, blah.';
}
?>
Your age










javascript:
function alert1()
{
if( confirm("Continue?"))
{
document.object return= true;
}else{
document.object_return= false;
}
}

2007-11-29 01:08:05 · 1 answers · asked by Anonymous

I have some tables for my database(SQL) and was wondering how to create a report so that:

for a member of staff, list his/ her schedule

Thanks

2007-11-29 00:13:53 · 4 answers · asked by mo 1

I'm receiving the above error, and here's the two parts that are interacting with each other (a page of all switches for controlling the application):

function checked($c1, $c2)
{
switch ($c1) {
case 0:
$c2=='value="OFF"';
break;
case 1:
$c2=='value="ON"';
break;
}
}
?>





$c1==$scheduler
checked($c1, $c2);
echo "";
?>





What's wrong in the code?

2007-11-28 19:38:24 · 4 answers · asked by Geek 2

i'm trying to make a site where certain pages are tableless. i was to use pure css.. but have a 'table' style apperance. i've designed the page with several divs with fixed widths.. using the float feature. some of these div's are to contain user submitted content.. so.. i'm having an issue with embedded images either exceding the width of the div.. or getting cut off by the right side. is there anyway to have a div stretch to the width of its content.. and default to the fixed width if no content stretches it?

2007-11-28 15:33:21 · 3 answers · asked by d00b13630 1

I'm working on a excel program that will allow my Construction business to electronically database our bid system. My idea is to have a main page in excel that will have columns labeled Date, Due Date, and Job Name. Every time a job is going to be bid we add it to this sheet.

From here I need to have the JOB NAME entered manually to be automatically copied(by code or if/than) to another sheet Alphabetically(Other sheets will be A,B,C,D,E,F,G all the way to Z.

Therefore if I enter Trump tower on the Main page it will copy it over to the "T" page automatically.

If I enter Airport on the Main page it will copy it over to the "A" page automatically

If there is a way to do this let me know.

2007-11-28 14:38:14 · 3 answers · asked by tfoster1107 2

Does anyone know a good online yearbook creation website that allows you to design a yearbook and have it printed and binded, etc.? ( This is all online, no downloads)

2007-11-28 14:34:28 · 1 answers · asked by Lee K 2

How do i code a command button to show the next form.

2007-11-28 14:32:51 · 2 answers · asked by Deleted 3

2007-11-28 12:22:23 · 2 answers · asked by trisha h 1

Using an input box (lstInput) and a button (btnCompute) I need to click on the button and enter numbers one at a time in a listbox (lstOutput) it needs to be keeping a running total of the sum

When entering" -1", a grand total will be displayed


Heres my code
Public Class frmPositiveNumbers

Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click

Dim num, total As Double

Total = 0

Do until num = -1

Num = Me.txtInput.Text
Me.lstOutput.Items.Add(num)
total += num

Loop

Me.lstOutput.Items.Add(total)

End Sub
End Class

I keep ending in an infinite loop, I am sure its something stupid I am doing.

2007-11-28 11:22:35 · 4 answers · asked by Brian D 4

I only want to data and do not want to loop.
$test = (1,2,3,4);

print_r($test) will print the data and the key, but I just want to output to be 1234

2007-11-28 10:48:30 · 4 answers · asked by Tasm 6

I am not the Web Master. She is not reachable.

2007-11-28 10:47:35 · 4 answers · asked by dtmanager@sbcglobal.net 1

fedest.com, questions and answers