SEARCH KEYWORD -- Random generation

Random number generation is one of most basic features in any
programming language. The basic utilization is always the same: generate
a random number between 0 and 1. With such a simple resource at hand we
sometimes overlook some interesting features.
What do we learn from the books?
The most obvious and maybe intuitive way to generate random numbers in Java is simply calling:
java.lang.Math.random()
Random generation is in the Math
utility class with abs, pow, floor...

This morning one colleague came over and talked about one script which used mcrypt responded very slowly, the server configurations are fine. But the reason for the slowness is unknown.
Here is one script which reproduces the issue:
<?php
$dmcryptText = "dummy";
$key = "foobar";
$size = mcrypt_get_iv_size(MCRYPT_BLOWFISH,MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($size); //Take care
$m = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $dmcryptText, MCRYPT_DECRYPT, $iv);
var_dump($m);
When 20 requests of&...

According to AllThingsD, Apple might launch its next generation of iPhone on September 10.
There is no detailed information about this new iPhone yet, it's also unknown whether it's a cheap one or other kind of versions. But it will equip with iOS 7 and Apple may launch the next generation of Mac OS--Maverick in next few weeks.
Since Apple acquired finger print recognition manufacturer AuthenTec with $356 million and it also applied the finger print unlock patent, so the next generation iPhone ...

A group of researchers (Arjen Lenstra and collaborators from EPFL Lausanne and James Hughes from Palo Alto) published a study, Ron was wrong Whit is right, of new vulnerabilities of cryptosystems. The New York Times picked up the story.
Although Lenstra et al discuss several cryptosystems, their results are
particularly relevant to those based on RSA. The title mirrors their
conviction that cryptosystems based on a single random element have
fewe...

The method to get random number in PHP is very simple, we only need to use rand() function.
int rand ( int $min , int $max )
One function call can return the random number in a specified range. But in fact, the random number in computer is actually pseudorandomness, generally to increase the randomness, we may set a random seed before calling rand().
void srand ([ int $seed ] )
According to other language features, we should pass a time value as a parameter to the srand() function, generally...

Recently a serious security vulnerability was found in MySQL/MariaDB. It relates to the access to the database. The issue is described below.When a user connects to MariaDB/MySQL, a token (SHA over a password and a random scramble string) is calculated and compared with the expected value. Because of incorrect casting, it might've happened that the token and the expected value were considered equal, even if the memcmp() returned a non-zero value. In this case MySQL/MariaDB would think that the p...

In PC era, Microsoft is the world's largest software service provider, its revenue is mainly from selling operating systems and other software services.With the advent of the era of mobile Internet, the free software service concept has been widely accepted, Microsoft has been forced to explore new business models.According to ZDNet, Microsoft's next-generation OS Windows Blue is expected to be released in mid of 2013. The biggest difference between the new version of the OS and the previ...

Microsoft just announced a new Microsoft Band on a new product release event held in New York today. This new device is the second generation of the smart wearable device since the first generation announced around 1 year back(29 October, 2014).
The biggest change of the new Microsoft Band is that it has a whole new design with curved screen. It now can be better adept to our body structure. In addition to this, there are a few other features as well. Below is a list of the features this new Mi...

Google has been restructured and it now has a parent company which is called Alphabet. This new company will fully own the original "Google". Larry Page will be the CEO of Alphabet and Sergey Brin will be the president of the new company. Sundar Pichai will be the new CEO of the new Google.
The new Google will continue its current business with some slimmed changes. While Alphabet will focus on working on the next generation of Internet and creating more billion user companies and services...

Just after a few weeks since Apple's famous goto fail bug, there is one bug in OpenSSL which catches the attention from the world again. The bug is named HeartBleed, found in OpenSSL library, a famous open source library supporting lots of SSL/TLS communication among server/client applications.
The reason why this bug catches the attentions from the world is it affects almost all sites which are using the affected OpenSSL library, these includes many applications like Nginx server, some v...