Random Letter & Number Generator
Hello:
I'm new to programming (FormCalc & JavaScript) and I'm using Adobe LiveCycle Designer ES 8.2 to create a dynamic form to post online. I need help with creating a "random letter & number generator" in code. The purpose is when someone opens the form online; I will create a unique number/letter combo on the form.
Any help or direction would be much appreciated. Thanks!
Hi,
I believe you are in the wrong forum. This is a forum for Adobe
LiveCycle Collaboration Service (LCCS) , a real-time social
collaboration platform.
You need to visit other forums under LiveCycle
http://forums.adobe.com/community/livecycle/livecycle_es?view=discussions
Primarily you can look for LiveCycle Forms sub forum.
Hope this helps
Thanks
Hironmay Basu
Similar Messages
-
When I click to open a PDF from Firefox it behaves very strangely. Instead of opening the PDF with its original filename (say for example: Report_on_the_weather.pdf) it changes the file name on opening. They open up with random 8-digit filenames (for example 5918Bd01.pdf). It does this for all PDF files. I would like to stop this behabviour. Any ideas?
My configuration:
Firefox 4
Windows XP
Adobe Acrobat 8.1 Standard (not the Reader, the full standard application)cor-el, thanks for responding. As it turns out the machine was compromised, probably due to the Java upgade from 6.x to the supposedly current 7.x version. I suspect one of the 'always open' tabs in my profile was aimed at a site that had been compromised to exploit the java vulnerability that has not apparently been fixed yet.
After removing Java, a current Panda AV scan detected three bad jar files. Further testing with MSCONFIG found a file in startup that did not belong, turns out to be a new exploit with very little coverage on virustotal (neither Panda nor McAfee detected it as malware) but as soon as it was taken out of the startup, Firefox started working perfectly.
Firefox was the parakeet in the cave, tipping over to let me know something was wrong.
The machine is in quarantine until a much more complete analysis is done. We may still rebuild it to be certain.
I'm giving you a 'solved' on this because the windows safe mode boot pointed the way to determining the problem. -
Random number generating too big?
Hello
This applet is basically a number guessing game. It uses a random gen for a number the user is supposed to guess.
I'm wondering if my number generator is causing too large a number for what I need. Because it always says my number I input is too small. I want a number between 1 and 1000.
thank you!
import java.applet.*;
import java.awt.*;
import javax.swing.*; // JApplet , JLabel, JTextField, JButton
import java.awt.event.*;
public class GuessAgain extends JApplet implements ActionListener{
int theNum;
int yourGuess;
int retNum;
// declare refs to GUI components
JLabel YourguessLabel, numIsLabel;
JTextField YourguessField, numIsField;
JButton againButton;
// setup GUI components
public void init(){
// obtain content pane give control to layout manager
Container container = getContentPane();
// new object of class FlowLayout
container.setLayout( new FlowLayout() );
// "Your guess" label
YourguessLabel = new JLabel( "Guess a number between 1 and 1000:" );
container.add( YourguessLabel );
// field
YourguessField = new JTextField( 10 );
YourguessField.setEditable( true );
container.add( YourguessField );
YourguessField.addActionListener( this ); // register this applet as YourguessField's actionlistener
// "Try again" button
againButton = new JButton( "If wrong try again" );
againButton.addActionListener( this );
container.add( againButton );
// "Number is" label
numIsLabel = new JLabel( "Number is:" );
// field
container.add( numIsLabel );
numIsField = new JTextField( 10 );
numIsField.setEditable( true );
container.add( numIsField );
numIsField.addActionListener( this );
retNum = makeNum();
}// end init
public void actionPerformed( ActionEvent event ){
int yourGuess;
yourGuess = Integer.parseInt( YourguessField.getText() );
theNum = makeNum();
displayMessage();
}//end actionperformed
public int makeNum()
int theNum = 1 + ( int ) ( Math.random() * 1000 ); // number generator
return theNum;
}// end makeNum
public void displayMessage()
if( yourGuess == theNum )
showStatus( "You got it!!" );
else{
if( yourGuess > theNum )
showStatus( "You are too high." );
else
showStatus( "You are too low." );
}// end else
}// end method display message
}// end classA troubleshooting technique is putting System.out.println statements to validate the programmer's opinion on how the code is supposed to work. If you add a System.out.println(yourGuess+" "+theNum); line as the first line in the displayMessage() method, it would validate your hypothesis that theNum is too large.
A hint to the problem - when you declare a variable inside a method with the same name as an instance variable, the compiler uses the method variable, not the instance variable. -
Plot xy graph using random number generator
How do i plot xy graph dynamically every 5 seconds with a random number generator?
X axis : Time
Y Axis : Random number generatorI've done tis so far. im able to plot dynamically every 1 second.
but the problem i am facing is The X axis display every 1 second.
i want it to be fixed 24 hours time format, and the data will gradually plots the data on y axis against x axis every one second, without changing the scale of the x axis (24hour time format) -
Hi does java have a random number generator. If it does can you point me to it please. Thank you.
you can use "java.Math.random()" this function returns a value which is greater than or equal
to 0.0 and less than 1.It returns a double value,so you can multiply by 10 and cast it to int,so that it
can produce numbers between 0 & 9.Yes, you can do that. But, as stated before, java.util.Random has methods that are easier to use for random int values than using java.Math.random is for random int values. It all depends what the OP wants. The OP hasn't come back with additional questions, or to say that he found his answer. So, we don't know whether he has his answer (he has several options now!) or not. :) -
Random Number Generator setSeed(); method???
I've searched and can't get a good understanding of the setSeed() method. I am suppose to use the loop control variable to seed the random number generator inside the loop. I need to use the same input everytime I use the random generator. When I compile it says int cannot be dereferenced.
for(int i = 0; i < array.length; i++)
int randnum = generator.nextInt(100);
randnum.setSeed(i);
array[i] = randnum;
If anyone can explain the setSeed() method that would be greatly appreciated. Thanks!badbro wrote:
Thanks for your help, but leave the smart comments to yourself. They are not needed. Thats what this forum is for.All of Paul's comments were dead spot on, and if you listen to him and take his advice to heart, it will only help you. If they make you upset, well then that's your problem, isn't it? My advice: grow up. -
Random Number Generator issues
Ok so I have an issue. I'm supposed to create a GUI app that has a frame that contains both a button and a textfield. When the button is pressed then a random number between 1 and 10 should appear in the textfield. I've got an illegal start of expression on line 49 which is the last private void...
So what have I done wrong?
* randomnumber.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
public class randomnumber extends JFrame
Random randomObject = new Random();
// declare controls used
static JButton startButton = new JButton();
static JTextField startTextField = new JTextField();
public static void main(String args[])
new randomnumber().show();
public randomnumber()
// frame constructor
setTitle("Random Number Generator");
getContentPane().setLayout(new GridBagLayout());
// add controls
GridBagConstraints gridConstraints = new GridBagConstraints();
startButton.setText("Generate a Number");
gridConstraints.gridx = 0;
gridConstraints.gridy = 0;
getContentPane().add(startButton, gridConstraints);
startButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
startButtonActionPerformed(e);
startTextField.setText("");
startTextField.setColumns(15);
gridConstraints.gridx = 2;
gridConstraints.gridy = 0;
getContentPane().add(startTextField, new GridBagConstraints());
private void startButtonActionPerformed(ActionEvent e)
myInt = randomObject.nextInt(11);
startTextField.setText(String.valueOf(myInt));
}Edited by: Hessmix on Oct 17, 2007 6:15 PMpublic randomnumber()
// frame constructor
setTitle("Random Number Generator");
getContentPane().setLayout(new GridBagLayout());
// add controls
GridBagConstraints gridConstraints = new GridBagConstraints();
startButton.setText("Generate a Number");
gridConstraints.gridx = 0;
gridConstraints.gridy = 0;
getContentPane().add(startButton, gridConstraints);
startButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
startButtonActionPerformed(e);
startTextField.setText("");
startTextField.setColumns(15);
gridConstraints.gridx = 2;
gridConstraints.gridy = 0;
getContentPane().add(startTextField, new GridBagConstraints());
}//<< Add a brace here
private void startButtonActionPerformed(ActionEvent e)
myInt = randomObject.nextInt(11);
startTextField.setText(String.valueOf(myInt));
}Did you add that brace? -
Random number generator. Even and odd numbers
I have a problem.
I have a random number generator, it goes from 0 to 20, I need to have two indicators, one will show how many numbers are pairs, and how many are not.
I tried to use the decimated 1D array, but since those numbers are random, it doesn´t work for me. I´m new with LabView, and I don´t know if there is some other way to make it work, I need some help, especially with some examples.
Thank you so much.
Solved!
Go to Solution.RavensFan wrote:
Spoiler (Highlight to read)
Create the array. Use quotient remainder to divide by 2. Now you have an array where all the odd numbers are now 1, and all the even numbers are now 0. Sum the array and you have the total number of odd numbers. The number of evens will be the length of the array divided by the # of odds.
Create the array. Use quotient remainder to divide by 2. Now you have an array where all the odd numbers are now 1, and all the even numbers are now 0. Sum the array and you have the total number of odd numbers. The number of evens will be the length of the array divided by the # of odds.
Haha I lost sight of the fact that he was looking for the amount off odds and evens. Good one.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
Help for random number generator???
hi there can anyone how to make simple random number
generator for slot machine , formula for chances in probability ,
or simple random number generator for slot machine , thanks
:)actualy the accurate RNG for slot machine ?? any idea?
-
Help: JSP Random Number Generator
hello every one,
Im trying to generate a random number using currentTimeMillis(), in Jsp, can you help me out and advice me how can this be done please.First you say you want a random number, then you say you want a unique one. Which is it?
Random numbers do not normally guaruntee uniqueness.
is there away i could use the currentTimeMillis(), What would you use it for? System.currentTimeMillis() is commonly used as a seed for a random number generator. The java.util.Random class uses it like that - take a look at that API link.
Or if its a homework question state the exact requirement - I'm guessing here. -
Random NUMBER generator help..
Hi all,
i'm having issues with my random number generator i'm trying to fill my array with random numbers but i keep getting it filled with zeros.... can any one tell me what i'm doing wrong i can;t figure it out..
for (int i =0; i < 100; i++){
int x=(int) (Math.random());
data[i] = x;
}From the API "Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0."
So casting the value to int is always going to result in a zero value.
You need to multiply by a value that is one larger than the value you want to be your maximum. For example:
int x = (int)(Math.random() * 100);
should create a random number from 0 to 99 -
Defining a lower boundery for a random number Generator
Hi,
I am using the code:
Random rand = new Random();
int x = rand.nextInt(50);
to generate a random number between 0 and 49
However I now need to only select a number between 20 and 49
Is there any way to give the random number generator a lower boundery as well as an upper boundery ??
Thank you
Craigexample:int x = rand.nextInt(30) + 20;Will generate a number between 20 and 49.
-
How do I create a random number generator?
I know I've done it before...but I can't remember quite how to get it going. I'm creating a math tutor program, which generates two random numbers and asks the user to add them, and if the answer is right they get a message that gives props and if they get it wrong they're told they got it wrong.
I can't get too far because I've forgotten how to make the number generator, so what exactly do you put in to get it?
import java.util.*;
public class AssignmentFour3 {
private static Random integer = new Random();
double number1 = 0;
Random string1 = new Random();
}DrClap wrote:
Generally I don't write my own random number generator. I just use the java.util.Random class.I read it as though that that is what he was going to use, but wasn't able to read the API docs to figure out what methods to use. ;-) -
We are doing some testing that requires 64MegaWords be written to our DSP memory with random values to do a validity check and without repeating sequences with using the previous value as the seed for the next and us passing it the initial seed. The dice one doesn't meet that criteria, and I was not sure how the continuous random number generator parameters work and if any of them would meet this criteria. Anyone have any information that might help?
Thanks,
SueHi suem,
There is no reason why you couldn't simply write a pseudo-random number generator by yourself. Simply select a random number algorithm you want to use and implement it in LabVIEW. You do not need to interface code written in another language in order to implement a pseudorandom number generator. If you have a DAQ card or something, you can also use inputr noise or some other hardware soruce to generate real random numbers. For that also LabVIEW is an excellent tool.
Tomi
Tomi Maila -
Uniform random number generator
anyone of u know how to generate UNIFORM RANDOM NUMBER GENERATOR that has serious faults ?
jwenting wrote:
uj_ is right (never thought I'd say that).
ANYTHING "uniform" is by definition not random.Well, the correct term is "random numbers from a uniform distribution". And there certainly exist such generators (athough they're pseudo-random of course).
I lost my temper because I've spent considerable time helping sosys only to realize he's a notorious cheater. Sosys claims to be a college student attending a CS class. With the knowledge, or rather lack thereof, he's displaying he must've cheated systematically for a long long time. I'm quite liberate at helping people with their homework but I won't help a leech become a programmer.
Maybe you are looking for
-
Anyone still having issue with this? Is apple even aware of the problem?
-
How do i get my iphone 4 jailbroken by apple?
how do i get my iphone 4 jailbroken by apple? I'm moving and i want to be able to use the same phone with another service provider.
-
SQL Developer not launching / W error Screenshots
Okay I'm a student in belgium. and i'm studying ICT. We are learning pl SQL with Oracle. Last week we had to use SQL Devloper, Now here comes my problem. I am pretty new at all this. But SQL developer doesn't launch at all!. I tried versions with and
-
My Microsoft Word for Mac has disappeared.
I have a Mac OSX 10.6.8 Macbook Pro 15. I am using Microsoft Office 2011. All the programs are working except for Word. It has disappeared and when I went to click on a Word document they converted to a Text Edit file. Please advise.
-
iTunes and TVU have severe conflict issues. anytime TVU is open, even if it is not running, iTunes songs or videos will skip terribly.