PageRenderTime 1605ms queryFilters 0ms Sphinxql 181ms GetByIds 1380ms meta 0ms repositoryFilters 6ms languageFilters 0ms sourceFilters 1ms

36,578 results for 'php mt_rand repo:dlorenso/dazlo' (1605 ms)

Source

Language

Repository

gui.php https://github.com/Drakekin/aVDR.git | PHP | 100 lines
1<?php
2	// Main GUI file
4	$bgr1 = mt_rand(0,15);
5	$bgg1 = mt_rand(0,15);
6	$bgb1 = mt_rand(0,15);
6	$bgb1 = mt_rand(0,15);
7	$bgr2 = mt_rand(0,15);
8	$bgg2 = mt_rand(0,15);
8	$bgg2 = mt_rand(0,15);
9	$bgb2 = mt_rand(0,15);
10	$colour = "#" . dechex($bgr1) . dechex($bgr2) . dechex($bgg1) . dechex($bgg2) . dechex($bgb1) . dechex($bgb2);
51			<span class="small">A <a href="http://random.org">random.org</a> based verifiable dice roller</span>
52			<p>aVDR is a verifiable (you can come back and check your rolls at any time, they don't change) dice roller. It uses <a href="http://random.org">random.org</a> to generate the random numbers using atmospheric noise. This means your dice rolls are truely random, unlike some other random number generators (such as PHP on Windows) which have a very low repeat rate. However, if our <a href="http://random.org">random.org</a> quota runs out, the dice roller will fall back to the built in linux random number generator, namely the PHP mt_rand() command.</p>
53			<p>Input a username (used to distinguish your rolls from everyone elses) and a dice roll (in the format <em>x</em>D<em>y</em> where <em>x</em> is the number of dice and <em>y</em> is the type up to a maximum of 20d100). There are several options. Any greyed out option is either out of order or not working yet.</p> 
53			<p>Input a username (used to distinguish your rolls from everyone elses) and a dice roll (in the format <em>x</em>D<em>y</em> where <em>x</em> is the number of dice and <em>y</em> is the type up to a maximum of 20d100). There are several options. Any greyed out option is either out of order or not working yet.</p> 
54			<form action="index.php" method="GET">
55				<strong class="big">Roll New Dice</strong><br />
php.js git://github.com/phpnode/YiiJS.git | JavaScript | 7,274 lines
1574    // END REDUNDANT
1575    strictForIn = this.php_js.ini['phpjs.strictForIn'] && this.php_js.ini['phpjs.strictForIn'].local_value && this.php_js.ini['phpjs.strictForIn'].local_value !== 'off';
1576    populateArr = strictForIn ? inputArr : populateArr;
1707    // END REDUNDANT
1708    strictForIn = this.php_js.ini['phpjs.strictForIn'] && this.php_js.ini['phpjs.strictForIn'].local_value && this.php_js.ini['phpjs.strictForIn'].local_value !== 'off';
1709    populateArr = strictForIn ? inputArr : populateArr;
2520    var targetObj = this.window;
2521    if (this.php_js && this.php_js.ini && this.php_js.ini['phpjs.extractTargetObj'] && this.php_js.ini['phpjs.extractTargetObj'].local_value) { // Allow designated object to be used instead of window
2522        targetObj = this.php_js.ini['phpjs.extractTargetObj'].local_value;
6920    // END REDUNDANT
6921    strictForIn = this.php_js.ini['phpjs.strictForIn'] && this.php_js.ini['phpjs.strictForIn'].local_value && this.php_js.ini['phpjs.strictForIn'].local_value !== 'off';
6922    populateArr = strictForIn ? inputArr : populateArr;
7157    // END REDUNDANT
7158    strictForIn = this.php_js.ini['phpjs.strictForIn'] && this.php_js.ini['phpjs.strictForIn'].local_value && this.php_js.ini['phpjs.strictForIn'].local_value !== 'off';
7159    populateArr = strictForIn ? inputArr : populateArr;
php-math.el git://github.com/ejmr/php-mode.git | Lisp | 350 lines
21;; To install php-ext.el:
22;; You can add (load "path/php-ext/php-ext.el") to your .emacs
23
24;; Description:
25;; Php ext is some skeleton templates for extend php-mode
26
27;; Math functions
28;; http://php.net/manual/en/ref.math.php
29;; file:///usr/share/doc/php-doc/html/ref.math.html
30
31(define-skeleton php-abs
32  "Insert an abs statement"
174
175(define-skeleton php-mt_rand
176  "Insert an mt_rand statement"
mt_rand.html git://github.com/kvz/phpjs.git | HTML | 54 lines
18layout: function
19title: PHP's mt_rand in JavaScript
20description: >-
21  Here’s what our current JavaScript equivalent to <a
22  href="https://php.net/manual/en/function.mt-rand.php">PHP's mt_rand</a> looks
23  like.
28alias:
29  - /functions/php/mt_rand/
30  - /functions/math/mt_rand/
30  - /functions/math/mt_rand/
31  - /php/mt_rand/
32  - /functions/mt_rand/
34{% codeblock lang:javascript %}module.exports = function mt_rand (min, max) { // eslint-disable-line camelcase
35  //  discuss at: https://locutus.io/php/mt_rand/
36  // original by: Onno Marsman (https://twitter.com/onnomarsman)
mt_rand.html https://github.com/andriuspetrauskis/phpjs.git | HTML | 54 lines
18layout: function
19title: PHP's mt_rand in JavaScript
20description: >-
21  Here’s what our current JavaScript equivalent to <a
22  href="http://php.net/manual/en/function.mt_rand.php">PHP's mt_rand</a> looks
23  like.
28alias:
29  - /functions/php/mt_rand/
30  - /functions/math/mt_rand/
30  - /functions/math/mt_rand/
31  - /php/mt_rand/
32  - /functions/mt_rand/
34{% codeblock lang:javascript %}module.exports = function mt_rand (min, max) { // eslint-disable-line camelcase
35  //  discuss at: http://locutus.io/php/mt_rand/
36  // original by: Onno Marsman (https://twitter.com/onnomarsman)
phpToJS.php git://github.com/phpnode/YiiJS.git | PHP | 1,640 lines
3 * A woefully naive, context unaware PHP to JavaScript token transformer.
4 * Relies on php.js for a lot of the built in PHP functions.
5 * HERE BE DRAGONS!
121		"import" => "imports",
122		"mt_rand" => "php.mt_rand",
123		"rtrim" => "php.rtrim",
1414 */
1415class phpClass extends phpBase {
1416	
1512 */
1513class phpProperty extends phpBase {
1514	/**
1547 */
1548class phpMethod extends phpBase {
1549	/**
mt_rand.js git://github.com/kvz/phpjs.git | JavaScript | 20 lines
1module.exports = function mt_rand (min, max) { // eslint-disable-line camelcase
2  //  discuss at: https://locutus.io/php/mt_rand/
3  // original by: Onno Marsman (https://twitter.com/onnomarsman)
5  //    input by: Kongo
6  //   example 1: mt_rand(1, 1)
7  //   returns 1: 1
13  } else if (argc === 1) {
14    throw new Error('Warning: mt_rand() expects exactly 2 parameters, 1 given')
15  } else {
mt_rand.js https://github.com/andriuspetrauskis/phpjs.git | JavaScript | 20 lines
1module.exports = function mt_rand (min, max) { // eslint-disable-line camelcase
2  //  discuss at: http://locutus.io/php/mt_rand/
3  // original by: Onno Marsman (https://twitter.com/onnomarsman)
5  //    input by: Kongo
6  //   example 1: mt_rand(1, 1)
7  //   returns 1: 1
13  } else if (argc === 1) {
14    throw new Error('Warning: mt_rand() expects exactly 2 parameters, 1 given')
15  } else {
Subs-Graphics.php https://github.com/leftnode/nooges.com.git | PHP | 1,001 lines
781	for ($i = 0; $i < 3; $i++)
782		$dotbgcolor[$i] = $background_color[$i] < $foreground_color[$i] ? mt_rand(0, max($foreground_color[$i] - 20, 0)) : mt_rand(min($foreground_color[$i] + 20, 255), 255);
783	$randomness_color = imagecolorallocate($code_image, $dotbgcolor[0], $dotbgcolor[1], $dotbgcolor[2]);
833			elseif ($fontColorType == 'random')
834				$char_fg_color = array(mt_rand(max($foreground_color[0] - 2, 0), $foreground_color[0]), mt_rand(max($foreground_color[1] - 2, 0), $foreground_color[1]), mt_rand(max($foreground_color[2] - 2, 0), $foreground_color[2]));
835			else
847				$font_x = $fontHorSpace == 'minus' && $cur_x > 0 ? $cur_x - 3 : $cur_x + 5;
848				$font_y = $max_height - ($fontVerPos == 'vrandom' ? mt_rand(2, 8) : ($fontVerPos == 'random' ? mt_rand(3, 5) : 5));
849
910		for ($i = mt_rand(0, 2); $i < $max_height; $i += mt_rand(1, 2))
911			for ($j = mt_rand(0, 10); $j < $total_width; $j += mt_rand(1, 10))
912				imagesetpixel($code_image, $j, $i, mt_rand(0, 1) ? $fg_color : $randomness_color);
916		{
917			$num_lines = $noiseType == 'high' ? mt_rand(3, 7) : mt_rand(2, 5);
918			for ($i = 0; $i < $num_lines; $i++)
securimage.php https://bitbucket.org/jsuto/piler.git | PHP | 2,212 lines
6 * Project:     Securimage: A PHP class for creating and managing form CAPTCHA images<br />
7 * File:        securimage.php<br />
8 *
38 *
39 * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
40 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
40 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
41 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
42 * @copyright 2013 Drew Phillips
52 3.5.1
53 - Fix XSS vulnerability in example_form.php (discovered by Gjoko Krstic - <gjoko@zeroscience.mk>)
54
168    // They can be passed as an array to the Securimage constructor, set below,
169    // or set from securimage_show.php and securimage_play.php
170
Image.php http://yurishop.googlecode.com/svn/trunk/ | PHP | 606 lines
453        if (!function_exists("imagepng")) {
454            #require_once 'Zend/Captcha/Exception.php';
455            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
495        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
496           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
497        }
498        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
499           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
500        }
556        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
557            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
558        }
559        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
560           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
561        }
Image.php http://display-ui.googlecode.com/svn/trunk/ | PHP | 606 lines
453        if (!function_exists("imagepng")) {
454            require_once 'Zend/Captcha/Exception.php';
455            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
495        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
496           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
497        }
498        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
499           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
500        }
556        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
557            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
558        }
559        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
560           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
561        }
Image.php http://simpleinvoices.googlecode.com/svn/trunk/ | PHP | 610 lines
453        if (!function_exists("imagepng")) {
454            require_once 'Zend/Captcha/Exception.php';
455            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
495        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
496           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
497        }
498        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
499           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
500        }
556        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
557            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
558        }
559        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
560           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
561        }
Image.php git://github.com/frapi/frapi.git | PHP | 600 lines
453        if (!function_exists("imagepng")) {
454            // require_once 'Zend/Captcha/Exception.php';
455            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
495        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
496           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
497        }
498        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
499           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
500        }
556        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
557            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
558        }
559        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
560           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
561        }
Image.php http://grupal.googlecode.com/svn/trunk/ | PHP | 610 lines
453        if (!function_exists("imagepng")) {
454            require_once 'Zend/Captcha/Exception.php';
455            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
495        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
496           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
497        }
498        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
499           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
500        }
556        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
557            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
558        }
559        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
560           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
561        }
Image.php http://firephp.googlecode.com/svn/trunk/ | text | 0 lines
447        if (!function_exists("imagepng")) {
448            require_once 'Zend/Captcha/Exception.php';
449            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
489        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
490           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
491        }
492        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
493           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
494        }
550        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
551            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
552        }
553        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
554           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
555        }
seccode.class.php https://zport.svn.codeplex.com/svn | PHP | 436 lines
158		for($i=0; $i <= $linenums; $i++) {
159			$color = $this->color ? imagecolorallocate($this->im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)) : imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]);
160			$x = mt_rand(0, $this->width);
162			if(mt_rand(0, 1)) {
163				imagearc($this->im, $x, $y, mt_rand(0, $this->width), mt_rand(0, $this->height), mt_rand(0, 360), mt_rand(0, 360), $color);
164			} else {
227			if($this->color) {
228				$this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
229				$this->shadow && $text_shadowcolor = imagecolorallocate($this->im, 255 - $this->fontcolor[0], 255 - $this->fontcolor[1], 255 - $this->fontcolor[2]);
270		for($i = 0; $i <= 3; $i++) {
271			$this->color && $this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
272			if($font[$i]['file']) {
313
314		$fontcolor = '0x'.(sprintf('%02s', dechex (mt_rand(0, 255)))).(sprintf('%02s', dechex (mt_rand(0, 128)))).(sprintf('%02s', dechex (mt_rand(0, 255))));
315		$strAction = "
seccode.class.php https://zport.svn.codeplex.com/svn | PHP | 422 lines
147		for($i=0; $i <= $linenums; $i++) {
148			$color = $this->color ? imagecolorallocate($this->im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)) : imagecolorallocate($this->im, $this->fontcolor[0], $this->fontcolor[1], $this->fontcolor[2]);
149			$x = mt_rand(0, $this->width);
151			if(mt_rand(0, 1)) {
152				imagearc($this->im, $x, $y, mt_rand(0, $this->width), mt_rand(0, $this->height), mt_rand(0, 360), mt_rand(0, 360), $color);
153			} else {
213			if($this->color) {
214				$this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
215				$this->shadow && $text_shadowcolor = imagecolorallocate($this->im, 255 - $this->fontcolor[0], 255 - $this->fontcolor[1], 255 - $this->fontcolor[2]);
256		for($i = 0; $i <= 3; $i++) {
257			$this->color && $this->fontcolor = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
258			if($font[$i]['file']) {
299
300		$fontcolor = '0x'.(sprintf('%02s', dechex (mt_rand(0, 255)))).(sprintf('%02s', dechex (mt_rand(0, 128)))).(sprintf('%02s', dechex (mt_rand(0, 255))));
301		$strAction = "
Image.php git://git.savannah.nongnu.org/tbk.git | PHP | 595 lines
447        if (!function_exists("imagepng")) {
448            require_once 'Zend/Captcha/Exception.php';
449            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
489        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
490           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
491        }
492        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
493           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
494        }
550        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
551            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
552        }
553        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
554           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
555        }
Utils.php http://sharebooks.googlecode.com/svn/trunk/ | PHP | 1,007 lines
732			$vertices = array (
733				mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25),
734				mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25),
736			);
737			$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha);
738			imagefilledpolygon($image, $vertices, 3, $color);
745			$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha);
746		//	$color = imagecolorallocate($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast));
747			imagefilledellipse($image, $x1, $y1, mt_rand($min_radius,$max_radius), mt_rand($min_radius,$max_radius), $color);
755			$y2 = mt_rand(-$height*0.25,$height*1.25);
756			$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha);
757			imagesetthickness ($image, mt_rand($min_thickness,$max_thickness));
764			$y1 = mt_rand(0,$height);
765			$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast),$object_alpha);
766			imagesetpixel($image, $x1, $y1, $color);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21