Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
random
- Page 1
Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by jprog1000
…lt;= 0 ) { xUp = true; xDx = ( int ) ( Math.
random
() * 5 + 2 ); } else if ( x >= this.panelwidth -…this.radius ) { xUp = false; xDx = ( int ) ( Math.
random
() * 5 + 2 ); } if (xUp) x += xDx; else…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by toneewa
…lt;= 0 ) { xUp = true; xDx = ( int ) ( Math.
random
() * 5 + 2 ); } else if ( x >= this.panelwidth -…this.radius ) { xUp = false; xDx = ( int ) ( Math.
random
() * 5 + 2 ); } if (xUp) x += xDx; else…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by toneewa
…lt;= 0 ) { xUp = true; xDx = ( int ) ( Math.
random
() * 5 + 2 ); } else if ( x >= this.panelwidth -…this.radius ) { xUp = false; xDx = ( int ) ( Math.
random
() * 5 + 2 ); } if (xUp) x += xDx; else…
Claude 3 Opus Vs. Google Gemini Vs. GPT-4 for Zero-Shot Text Classification
Programming
Computer Science
2 Months Ago
by usmanmalik57
… for positive and negative sentiments. The following script selects 100
random
tweets. ``` # Remove rows where 'airline_sentiment' or 'text' are NaN dataset…
What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by Dani
Just a
random
question to try to get some good discussion going. For …
Re: Improve HAVING BY performance
Programming
Databases
2 Months Ago
by Biiim
… seconds, that's about 130mb/s to 400mb/s plus
random
access speed increases (HDD is very bad at 6.3ms…
Re: Do you participate in any other communities?
Community Center
Geeks' Lounge
1 Month Ago
by Dani
Super familiar with Sitepoint :) Their forums used to be a big competitor to DaniWeb back in the day. Why did you inject a
random
spammy link into the middle of your post? :(
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by jprog1000
Thank you so much for your reply and additions! It is certainly working as I wanted. I will read through the code you have added and ask you any questions I might have. I hope you don't mind. Regards
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by Dani
I’ll mark this question solved :)
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by Dani
… oh, sorry, missed the bit about you still needing clarifications. Feel feee to ask :) I’ll now unmark this topic as solved. /facepalm
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by jprog1000
Hello, Thank you again so much! All your additions are clear, but it seems like whenever two balls collide, more than one ball is added to the arraylist and painted. Any way to have just one ball added to the panel for every collision? Have some kind of a toggle flag in paintcomponent? Regards
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Months Ago
by toneewa
Yes, this is true. Overlapping ball spawns can do that causing a chain reaction. Something like that could be done. How you handle the spawning of the new ball is what I played with a bit before. You will see better collision detection changing to: g.fillOval(ball.getX(), ball.getY(), 1 * ball.getRadius(), 1 * ball.getRadius());
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Month Ago
by jprog1000
Got it. Thank you so much!
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Month Ago
by aishamushtaq
Hi, Its helpful for me. I got my answer.
Re: Trying to animate sprite using DirectX9
Programming
Software Development
2 Months Ago
by Pavel_11
Hello, it is unneccessarily to use right movex or leftmovex , because it is to much variables. You should to use one variable movex to make it with minus or plus sign in your update function; by pressing left or right keys; because the one thing which is changable is a picture; I mean in global sense; variables like leftx, right x should be one…
Re: What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by jacobss
One of my favorite productivity hacks outside of coding is the Pomodoro Technique.
Re: What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by Reverend Jim
Odd that something so basic and obvious needs to be named. Of course, "Pomodoro Technique" is a lot shorter than "go hide in the server room so my boss won't keep interrupting me so I can get some work done" technique. At least that's what I used to call it.
Re: What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by Dani
I don’t think there’s a better answer than that. Productivity hack when not coding are none other than breaks from coding. It’s so simple :)
Re: What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by Dani
So basically my Palo Alto technique :)
Re: What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by Reverend Jim
>So basically my Palo Alto technique :) A lot easier and more pleasant in mid-winter in Palo Alto than here in Winnipeg.
Re: What's your favorite productivity hack outside of coding?
Community Center
1 Month Ago
by midnightbastet
Having an 1 hour nap
Random number functions
Programming
Software Development
14 Years Ago
by mrnutty
Random
number generator under its own namespace. Its a sample program.
Random Audio Commercials?
Hardware and Software
Information Security
14 Years Ago
by firebat757
Random
audio commercials play when I have no browsers or windows …
Random number and Mode
Programming
Software Development
10 Years Ago
by chubbyy.putto
Random
Number: Whenever I run it show me an error. Here …
Re: Random Number Generator with MinGW and Boost
Programming
6 Years Ago
by rubberman
Random
number generators is a "mature" science. This may help you understand the subject matter: http://www.phy.ornl.gov/csep/CSEP/RN/RN.html
Re: Random number generation in C#
Programming
Software Development
11 Years Ago
by arunkumars
….Next() finds the next
random
# bet 100 and 1000 int numberTotal = 0; //declaring the variable &…(100, 1000); Console.WriteLine(number.ToString()); //program prints the next
random
# //numberTotal += number; //need to keep a running sum of the…
Re: Random number generation
Programming
Software Development
19 Years Ago
by FireNet
Random
Number generation is easy but when you call rand() you only get a number from an array.To get true
random
numbers you have to seed that array using srand(); call srand(GetTickCount());Then you start getting
random
numbers.
Re: Random Access Vs. Sequential access (When to use which)
Programming
Software Development
16 Years Ago
by Narue
Random
access is for when you can't predict the access … a sequential pattern, or the access medium doesn't support
random
access.
Re: Random shutdowns
Hardware and Software
Microsoft Windows
15 Years Ago
by EMCCleveland
Random
shut downs are a bit difficult to track down but …
Re: random printing???
Programming
Software Development
14 Years Ago
by Stefano Mtangoo
Random
number mean that it changes value. The position is the same. Did you wanted to change position or value?
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC