233 Topics

Member Avatar for
Member Avatar for jonsan32

I'm using the code below to get a random number of items from an array, but I'd like to just get 3-5 random numbers from the provide range to display. Right now, it either shows 1, all, or any amount in between. I'm also good with completely changing up my …

Member Avatar for Dani
0
77
Member Avatar for mukti itb

I need help in filling array in Pascal with random number. I have 9 empty array ( A: array[1..10] of integer ), and i want to fill the array with integer for 1 to 9 randomly, but one number can only be choosen one time. So when a number (eg. …

Member Avatar for Horvath
0
6K
Member Avatar for Xozz

I'm writing a game in PHP. Now the script generates a random number to get the players registered. But: the number generated is the same for every player. It's about this line: $activationkey = rand( 1000000000, 9999999999 ); Every player gets the same key. How can this be? Any help? …

Member Avatar for Reverend Jim
0
26
Member Avatar for MosaicFuneral

Haven't programmed in a long time. Last project was a GCODE pathway generator I wrote several years back. My compiler is obviously several years out of date. Uses time(), itoa(), rand(). Current standard compliant compilers should have <chrono>, <thread>, <random>, and to_string() in suppliment to those more deprecated functions. This …

Member Avatar for DGPickett
2
3K
Member Avatar for vinod tik

i have a problem in displaying the values of a cookie dynamically code goes as... <?php $x=array(); include("connect.php");//database connection file $temp=$_GET['id']; setcookie(count($x)+1,$temp); echo $_COOKIE['$x[1]']; ?> // how do i display the value of cookie every time... it is over written.... i have tried it with using array.. in short i …

Member Avatar for alan.davies
0
2K
Member Avatar for aman rathi

Is there any method in java to generate random number (integer, byte or float). please tell me if any i need it in my program. if possible please give full example. thanks.

Member Avatar for stultuske
1
1K
Member Avatar for tryphy

Hi guys... I want some help of how to call images from a folder.... Its like..v have a folder called images and it has many images in it.....but i need only 6 images to display in a php webpage...when the webpage is reloaded, it displays another images...its like its displaying …

Member Avatar for cereal
0
3K
Member Avatar for Dani

Last night, a friend mentioned to me that one day he was trying to fetch a random 5 rows from a MySQL database. He researched online, and was eventually presented with a working solution in which he would generate five random numbers. Then, he would query the database for items …

Member Avatar for abubaker_2
4
585
Member Avatar for DeanMSands3

Hi, Daniweb. I have this hobby project I'm playing with where I need to generate data for a MonteCarlo simulation. The data needs to fit within a bell-curve around a given mean with a standard-deviation. I'm trying to figure out which random distribution system I need to use and how …

Member Avatar for DeanMSands3
0
369
Member Avatar for vegaseat
Member Avatar for Ali_65
2
11K
Member Avatar for joshl_1995

Hello Community, I was just clearing up my (Android) phone and when I was looking in the downloads folder there is an Adobe Acrobat folder and inside of it is a random file I couldn't imagine I've downloaded its name is 'ChandlerIncidentReview.pdf' no a single clue how it got on …

Member Avatar for rubberman
0
395
Member Avatar for vegaseat

Just a simple password creator using Python code. The length of the password can be set and the characterset could be changed if you so desire.

0
561
Member Avatar for vegaseat

Part 3 of the taste of Swift explores class objects in Apple's Swift language. A class allows you to group methods (class functions) together that belong together. Class Person groups some information of people working in an office. Class Pay inherits class Person and adds pay information. Class File groups …

Member Avatar for ddanbe
1
348
Member Avatar for jonsan32

Trying to insert both of these arrays of random quotes on the same page so that both show at the same time. I realize I have to rename some of the elements within, but apparently I have no clue which. I've tried giving each rannum, ShowText, and RndText a number …

Member Avatar for RobertDecousta
0
320
Member Avatar for vegaseat

This shows you how to create a flashcard like quiz game using a Python dictionary. It's up to you to explore the approach and make this a more meaningful game.

Member Avatar for Chance_1
2
7K
Member Avatar for ogsirus

Hi guys, I am trying to write a program which picks the closest number possible out of a dictionary. The dictionary contains 50 doubles values, and I use a random double to pick the number i want to get the closest to if that makes sense. Currently I am using …

Member Avatar for ogsirus
0
849
Member Avatar for Gl753

Sorry for the misleading question guys, I know how to generate two random numbers but I want to use them in One JOptionPane input Dialogbox so the user can add the two numbers. Below is my code of what I have done so far I know it's not a lot …

Member Avatar for Gl753
0
452
Member Avatar for Niloofar24

Hello. Imagin we have a python file with many alphabet letters like this: (Which is infact meaningful like i am a programmer) i a m a p r o g r a m m e r How can i print them randomly that nobody could read it? sth like this …

Member Avatar for Lardmeister
0
260
Member Avatar for abrar7866

int firstarray[12][7] = { }; double firstClass(int airplane, int seats, double price) {cout<<setw(60)<<"---------------------... cout<<setw(60)<<"You are in **first class** booking screen\n"; cout<<setw(60)<<"----------------------... cout<<"\n"; cout<<"How many seats would you like to book for first class?"<<" ";cin>>seats; for(int row=0; row<2; row++) { for(int column=0;column<7;column++) { } } } The thing is, The first …

Member Avatar for Maritimo
0
328
Member Avatar for jonsan32

Let's say I have a banner on my site that randomly rotates between images that depict the month of January. Is it possible to have 10 images randomly rotate the entire month, then to have a new 10 images rotate randomly for the following month? I also need each image …

Member Avatar for mattster
0
499
Member Avatar for skyyadav

Hi I have two edittexts and I have to generate random no and randomly show in one of two edittexts. generating random no is ok,but randomly showing in one of the edittext, I donot have any idea. if any one have any hint or any arrticle.,Please help

Member Avatar for skyyadav
0
195
Member Avatar for <M/>

I seem to not be able to identify why the styling does not appear at all on my page... Did i reference something incorrectly? It all appears right to me... syntax, quotes, tags all look right. Does anyone have an idea what may be happening? Sorry if my question is …

Member Avatar for shashikumar s g
1
696
Member Avatar for Start4me

I've made a timer and six labels. Then a number is being generated for each label seperately. After testing how it works, I found out that sometimes two same numbers are being generated at the same time. In the picture attachment you can see how two numbers were generated at …

Member Avatar for Minimalist
0
1K
Member Avatar for berserk

i have an issue, my code works wonderfully for the pupose its designed for however for security reasons i need th epages page my login page to have either randomized links or just links that cannot be bookmakred too so that one can bypass the login page. My login page …

Member Avatar for berserk
0
461
Member Avatar for adrianrayce

Hello everyone, so i am basically new to C++ coding and i am trying to write the randNum function in a way that it will give me these ranges The range for this row is: 1 to 10: 5 4 10 2 7 9 1 8 9 6 The range …

Member Avatar for Avishek_1
0
313
Member Avatar for SaroGFX

Dear Daniweb, I just got the following [HTML5 music player](http://www.audioplayerhtml5.com/player_blackControllers_WithoutPlaylist_Ex1.html), which gets it's music from a list I provide in HTML like this: <ul> <li class="xtitle">Follow Me Here B</li> <li class="xauthor">Author Name</li> <li class="xsources_mp3">audio/adg3com_freeform.mp3</li> <li class="xsources_ogg">audio/adg3com_freeform.ogg</li> </ul> <ul> <li class="xtitle">This is Freeform C</li> <li class="xauthor">Author Name</li> <li class="xsources_mp3">audio/wm_follow_me.mp3</li> <li class="xsources_ogg">audio/wm_follow_me.ogg</li> …

0
310
Member Avatar for Kniggles

I am trying to write a querry to pull just one playername out of a database by random, can anyone see what I am missing please ? open base< $sql="select playername from tablejollys where (ID % 1000) = floor(rand() * 1000) order by rand() limit 1"; $result=mysql_query($sql); echo ['playername'] ; …

Member Avatar for Kniggles
0
257
Member Avatar for jonsan32

Trying to figure out how to have 2 sets of images display randomly on the same page. I know I have to rename something, but nothing I try is working. Any help would be greatly appreciated. Thanks. For now I just have the two scripts repeated back to back before …

Member Avatar for jonsan32
0
336
Member Avatar for castajiz_2

Why isn't the Microsoft built in class Random class an type static class as the Math. class is. Why didn't they make this class static?

Member Avatar for Ketsuekiame
0
359
Member Avatar for mstoltz1

Ok, so I just made this account because I'm super stuck. Basically I need to create a math quiz that takes a users input (1 through 12), have it spit out a question, i.e What is 5 x 12? however if the user enters 5, it must randomly generate a …

Member Avatar for JamesCherrill
0
2K

The End.