Generate a number of 6 ~ 16 user names, mainly text operations, the colleague premise is to have a string package. consists of three programs.
Program one: Responsible for the random extraction of data from the dictionary, write a new file. (1.php)
* * Extract the random value from the dictionary file.
$file 1 = "./wor
Package Com.wansha;
Import Java.util.Random;
public class Atest {public
static void Main (string[] args) {
/**
*
* The first method:
* Using the Java.util.Random method c7/>*/
Random Random = new Random ();
/**
* nextint randomly generates random in
Write a method that uses the above algorithm to generate a random integer of a specified number (for example, three). //A,c,m is constantR = (R * A + C)% mModulus=231-1=int. MaxValuemultiplier=75=16807C=0 It is possible to repeat after the number of 231-2 has been displayed. public class Suiji {/*** @param args*/public static void Main (string[] args) {TODO aut
Pull Bastard: Many people have received a variety of invitation code, but few people to study the invitation code is if generated, in the project encountered generate random six-bit invitation code, and the invitation code in the database store, so that is the invitation code can not be repeated.
Idea: I used to generate four invitation codes for example. We can
Wrote a program, mainly used to detect the MySQL database empty password and weak password,Here, three types of weak passwords are defined:1. Continuous numbers, such as 123456, are implemented in Get_weak_num2. Continuous letters, such as ABCDEF, are implemented in Get_weak_characterOf course, the numbers are random.3. Random combination of numbers and letters. Implemented in Get_weak_num_character.A list
has been used to generate the verification code method, take 4 digits no problem, the result plus the letter, take 6 digits, the efficiency is very low.
Improved a bit, the method is as follows
Copy Code code as follows:
var text2 = "";
var random = new Random ((int) DateTime.Now.Ticks);
Const string Text
This article describes how to use PHP to generate a function with a random string with a custom length. For more information, see
Php randomly generated strings can be customized to define their own length, which is often encountered in practical application development.
The Code is as follows:
// Randomly generate
Generate an Activation codePackage jihuoma;//generates activation code: similar to 2hs0-sskj-9hho-a55dpublic class Test {public static void main (string[] args) {String str= ""; for (int i = 1; i Generate 10 Activation codes (more than one layer of loops outside)Package jihuoma;//generates 10 activation codes public cl
Unique Code Random Code
The more specific needs are this
The database may gradually insert no more than 10w records, want to add a field, each record of the value of this field is a 8-bit code
1. It looks like a random code, like Dlkpownd Ouichgeb.
2. Can not be "easy" to crack such as id=1 corresponding to the aaaaaaaa id=2 corresponding Aaaaaaab of course, this description may be repeated with the fir
only reference a small amount of information, with an average of 0.2 articles referenced in one paper. Reference information can be randomly added as mentioned in a paper on the experiment dataset using dblp. Inspired by this, I intend to add 20 random references to each paper, so I wrote the following SQL statement:
String SQL = "insert into citation (pId1, pId2) values (select pId from papers limit ?, 1)
PHP generates a simple implementation of a specified random string, and PHP generates a string
This article describes a simple implementation of PHP to generate a specified random string. Share to everyone for your reference. The
Public class randomsort {
/*** Generate 10 random non-repeated numbers from 1 to 10 and sort them in ascending order.* @ Param ARGs*/Public static void main (string [] ARGs ){Int A [] = new int [10];Int I = 0;While (I Int Rand = (INT) (math. Random () * 10 + 1 );If (istrue (RAND, )){A [I] = rand;I ++;}}Printa ();Paixu
use the For loop to bulk create 10 HTML files in the/oldboy directory, where each file needs to contain 10 random lowercase characters plus a fixed string oldboy, with the following name examples:[[email protected]]# ls/oldboyapquvdpqbk_oldboy.html mpyogpsmwj_oldboy.html txynzwofgg_oldboy.htmlbmqiwhfpgv_oldboy.html mtrzobsprf_oldboy.html vjxmlflawa_oldboy.htmlJhjdcjnjxc_oldboy.html qeztkkmewn_oldboy.htmlJpv
Import Java.util.random;public class Randomnumber{public static void Main (string[] args) {// Generate random number System.out.println ("Math.random ():" + math.random ()) using Java.lang.Math's Random method;// Constructs a Java.util.Random object System.out.println ("Random
It is a headache to think about passwords one by one when creating a large number of users. Using php to randomly generate a secure and reliable password is convenient and fast, and you can add your own strings, you can use the FTP password, Mysql password, and website background password to implement code:
Header ("Content-type: text/html; charset = UTF-8 ");
Function getRandPass ($ length = 6 ){
$ Password = '';
// Add the desired character
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.