PageRenderTime 408ms queryFilters 0ms Sphinxql 292ms GetByIds 80ms meta 0ms repositoryFilters 11ms languageFilters 0ms sourceFilters 1ms

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

Source

Language

Repository

captcha_gd.php git://github.com/MightyGorgon/icy_phoenix.git | PHP | 2,644 lines
1<?php
2/**
69			list($min, $max) = $characters[$i]->range();
70			$sizes[$i] = mt_rand($min, $max);
71
93				$current_colour = $scheme[array_rand($scheme)];
94				imageline($img, mt_rand(0,4), mt_rand($y - 3, $y), mt_rand($this->width - 5, $this->width), mt_rand($y - 3, $y), $current_colour);
95			}
103				$current_colour = $scheme[array_rand($scheme)];
104				imagedashedline($img, mt_rand($x -3, $x + 3), mt_rand(0, 4), mt_rand($x -3, $x + 3), mt_rand($this->height - 5, $this->height), $current_colour);
105			}
284			6 => array(
285				array(mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1)),
286				array(0,0,0,0,0,0,0,mt_rand(0,1),0,0,0,0,0,0,0),
288				array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
289				array(mt_rand(0,1),0,mt_rand(0,1),0,0,0,0,0,0,0,0,0,0,0,0),
290			),
TableServiceFunctionalQueryTest.php git://github.com/WindowsAzure/azure-sdk-for-php.git | PHP | 649 lines
1<?php
2
14 * 
15 * PHP version 5
16 *
18 * @package   Tests\Functional\WindowsAzure\Table
19 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
20 * @copyright 2012 Microsoft Corporation
21 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
22 * @link      https://github.com/windowsazure/azure-sdk-for-php
23 */
281        if ($depth == $targetDepth) {
282            switch (mt_rand(0,2)) {
283                case 0:
285                case 1:
286                    return Filter::applyConstant(mt_rand(0,1) == 1, EdmType::BOOLEAN);
287                case 2:
installer.php git://pkgs.fedoraproject.org/gallery3 | PHP | 269 lines
190    if (!function_exists("mysql_query") && !function_exists("mysqli_set_charset")) {
191      $errors[] = "Gallery 3 requires a MySQL database, but PHP doesn't have either the <a href=\"http://php.net/mysql\">MySQL</a> or the  <a href=\"http://php.net/mysqli\">MySQLi</a> extension.";
192    }
200    if (!(function_exists("spl_autoload_register"))) {
201      $errors[] = "PHP is missing <a href=\"http://php.net/spl\">Standard PHP Library (SPL)</a> support";
202    }
230    if (!function_exists("json_encode")) {
231      $errors[] = "PHP is missing the <a href=\"http://php.net/manual/en/book.json.php\">JavaScript Object Notation (JSON) extension</a>.  Please install it.";
232    }
234    if (!ini_get("short_open_tag")) {
235      $errors[] = "Gallery requires <a href=\"http://php.net/manual/en/ini.core.php\">short_open_tag</a> to be on.  Please enable it in your php.ini.";
236    }
238    if (!function_exists("ctype_alpha")) {
239      $errors[] = "Gallery requires the <a href=\"http://php.net/manual/en/book.ctype.php\">PHP Ctype</a> extension.  Please install it.";
240    }
TableServiceFunctionalQueryTest.php https://hg.codeplex.com/bukuphpjs | PHP | 672 lines
1<?php
2
14 * 
15 * PHP version 5
16 *
18 * @package   Tests\Functional\WindowsAzure\Table
19 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
20 * @copyright 2012 Microsoft Corporation
21 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
22 * @link      https://github.com/windowsazure/azure-sdk-for-php
23 */
289        if ($depth == $targetDepth) {
290            switch (mt_rand(0,2)) {
291                case 0:
293                case 1:
294                    return Filter::applyConstant(mt_rand(0,1) == 1, EdmType::BOOLEAN);
295                case 2:
imagebuilder.php https://bitbucket.org/gopchu/gopchu.org.git | PHP | 161 lines
116	$vertices = array (
117		mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25),
118		mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25),
120	);
121	$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha);
122	imagefilledpolygon($image, $vertices, 3, $color);
129	$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha);
130//	$color = imagecolorallocate($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast));
131	imagefilledellipse($image, $x1, $y1, mt_rand($min_radius,$max_radius), mt_rand($min_radius,$max_radius), $color);
139	$y2 = mt_rand(-$height*0.25,$height*1.25);
140	$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha);
141	imagesetthickness ($image, mt_rand($min_thickness,$max_thickness));
148	$y1 = mt_rand(0,$height);
149	$color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast),$object_alpha);
150	imagesetpixel($image, $x1, $y1, $color);
captcha_gd.php https://bitbucket.org/VolCh/phpbb3-russian-stable.git | PHP | 2,640 lines
79			$denom = max(1.3, $denom);
80			$offset[$i] = phpbb_mt_rand(0, (int) round((1.5 * $width_avail) / $denom));
81			$width_avail -= $offset[$i];
89				$current_colour = $scheme[array_rand($scheme)];
90				imageline($img, mt_rand(0,4), mt_rand($y - 3, $y), mt_rand($this->width - 5, $this->width), mt_rand($y - 3, $y), $current_colour);
91			}
99				$current_colour = $scheme[array_rand($scheme)];
100				imagedashedline($img, mt_rand($x -3, $x + 3), mt_rand(0, 4), mt_rand($x -3, $x + 3), mt_rand($this->height - 5, $this->height), $current_colour);
101			}
280			6 => array(
281				array(mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1)),
282				array(0,0,0,0,0,0,0,mt_rand(0,1),0,0,0,0,0,0,0),
284				array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
285				array(mt_rand(0,1),0,mt_rand(0,1),0,0,0,0,0,0,0,0,0,0,0,0),
286			),
captcha.php https://bitbucket.org/wayfarer/verse.git | PHP | 237 lines
49        $color = imagecolorallocatealpha($image, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255), 110);
50        imagestring($image, mt_rand(1, 3), mt_rand(-$width * 0.25, $width * 1.25), mt_rand(-$height * 0.25, $height * 1.25),
51                    $acceptedCharsC{mt_rand(0, strlen($acceptedCharsC) - 1)}, $color);
51                    $acceptedCharsC{mt_rand(0, strlen($acceptedCharsC) - 1)}, $color);
52        imagestring($image, mt_rand(1, 3), mt_rand(-$width * 0.25, $width * 1.25), mt_rand(-$height * 0.25, $height * 1.25),
53                    $acceptedCharsV{mt_rand(0, strlen($acceptedCharsV) - 1)}, $color);
78
79        imagecopyresized($buffer2, $buffer, 2, -5, 0, 0, mt_rand(30, 40), mt_rand(30, 40), 10, 14);
80        //  $buffer=imagerotate($buffer2,mt_rand(-25,25),$color_white);
96        $color = imagecolorallocatealpha($image, mt_rand(0, 200), mt_rand(0, 200), mt_rand(0, 200), 110);
97        imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(10, 40), mt_rand(10, 40), $color);
98    }
102    for ($i = 0; $i < 12; $i++) {
103        $color = imagecolorallocatealpha($image, mt_rand(0, 200), mt_rand(0, 200), mt_rand(0, 200), 110);
104        imagesetthickness($image, mt_rand(8, 20));
Image.php https://bitbucket.org/openfisma-ondemand/openfisma.git | PHP | 609 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 https://bitbucket.org/menvil/test.git | PHP | 590 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        }
Image.php https://bitbucket.org/netglue/zf-1.12-release.git | PHP | 609 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 https://bitbucket.org/baruffaldi/webapp-urltube.git | PHP | 495 lines
363        if (!function_exists("imagepng")) {
364            require_once 'Zend/Form/Exception.php';
365            throw new Zend_Form_Exception("Image CAPTCHA requires PNG support");
395        for ($i=0; $i<100; $i++) {
396           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
397        }
398        for($i=0; $i<5; $i++) {
399           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
400        }
456        for ($i=0; $i<100; $i++) {
457            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
458        }
459        for ($i=0; $i<5; $i++) {
460           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
461        }
Image.php https://bitbucket.org/baruffaldi/cms-php-bfcms.git | PHP | 494 lines
362        if (!function_exists("imagepng")) {
363            require_once 'Zend/Form/Exception.php';
364            throw new Zend_Form_Exception("Image CAPTCHA requires PNG support");
394        for ($i=0; $i<100; $i++) {
395           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
396        }
397        for($i=0; $i<5; $i++) {
398           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
399        }
455        for ($i=0; $i<100; $i++) {
456            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
457        }
458        for ($i=0; $i<5; $i++) {
459           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
460        }
Image.php https://bitbucket.org/mkrasuski/magento-ce.git | PHP | 625 lines
470        if (!function_exists("imagepng")) {
471            #require_once 'Zend/Captcha/Exception.php';
472            throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support");
512        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
513           imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
514        }
515        for($i=0; $i<$this->_lineNoiseLevel; $i++) {
516           imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
517        }
573        for ($i=0; $i<$this->_dotNoiseLevel; $i++) {
574            imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color);
575        }
576        for ($i=0; $i<$this->_lineNoiseLevel; $i++) {
577           imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color);
578        }
Image.php https://github.com/zf/ZendFramework-Library.git | 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        }
Graphics.subs.php https://github.com/Arantor/Elkarte.git | PHP | 1,010 lines
786	for ($i = 0; $i < 3; $i++)
787		$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);
788	$randomness_color = imagecolorallocate($code_image, $dotbgcolor[0], $dotbgcolor[1], $dotbgcolor[2]);
838			elseif ($fontColorType == 'random')
839				$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]));
840			else
915		for ($i = mt_rand(0, 2); $i < $max_height; $i += mt_rand(1, 2))
916			for ($j = mt_rand(0, 10); $j < $total_width; $j += mt_rand(1, 10))
917				imagesetpixel($code_image, $j, $i, mt_rand(0, 1) ? $fg_color : $randomness_color);
921		{
922			$num_lines = $noiseType == 'high' ? mt_rand(3, 7) : mt_rand(2, 5);
923			for ($i = 0; $i < $num_lines; $i++)
943			// Put in some ellipse
944			$num_ellipse = $noiseType == 'extreme' ? mt_rand(6, 12) : mt_rand(2, 6);
945			for ($i = 0; $i < $num_ellipse; $i++)
Image.php https://github.com/monkeycraps/swoole_framework.git | PHP | 546 lines
348        {
349            imageString($aimg,1,mt_rand(1,$img_width),mt_rand(1,$img_height),"*",imageColorAllocate($aimg,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255)));
350            //其实也不是雪花,就是生成*号而已。为了使它们看起来"杂乱无章、5颜6色",就得在1个1个生成它们的时候,让它们的位置、颜色,甚至大小都用随机数,rand()或mt_rand都可以完成。
353        {
354            imageString($aimg, mt_rand(8,12),$i*$img_width/4+mt_rand(1,8),mt_rand(1,$img_height/4), $_SESSION['authcode'][$i],imageColorAllocate($aimg,mt_rand(0,100),mt_rand(0,150),mt_rand(0,200)));
355        }
443            $fontcolor = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
444            imagearc($im, mt_rand(-10, $width), mt_rand(-10, $height), mt_rand(30, 300), mt_rand(20, 200), 55, 44, $fontcolor);
445        }
446        for ($i = 0; $i < 255; $i++) {
447            $fontcolor = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
448            imagesetpixel($im, mt_rand(0, $width), mt_rand(0, $height), $fontcolor);
451        for ($i = 0; $i < $length; $i++) {
452            $fontcolor = imagecolorallocate($im, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120)); //这样保证随机出来的颜色较深。
453            $codex = msubstr($code, $i, 1);
HTTPQuery.php https://bitbucket.org/0xDB/text2speach.git | PHP | 922 lines
1<?php
2
3/**
4 * @name: HTTPQuery.php
5 * @description: Thing to work with HTTP protocol
12# http://ru.php.net/manual/en/ref.url.php
13# TODO: refactor HTTPSocket class using <http://ru.php.net/manual/en/ref.http.php>
14#  & discover <http://ru.php.net/manual/en/class.httpresponse.php>
23if (!class_exists('WhoIS'))
24	@require_once dirname(__FILE__).'/WhoIS.php';
25if (!class_exists('WhoIS'))
86	public function rndUserAgent() { # needs to be improved
87		if(mt_rand(0,1)) $this->UserAgent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)';
88		if(mt_rand(0,1)) $this->UserAgent = 'Mozilla/5.0 (compatible; Opera 9.80; Windows NT 6)';
88		if(mt_rand(0,1)) $this->UserAgent = 'Mozilla/5.0 (compatible; Opera 9.80; Windows NT 6)';
89		if(mt_rand(0,1)) $this->UserAgent = 'Safari Mozilla 4.6';
90		if(mt_rand(0,1)) $this->UserAgent = 'Mozilla/3.0 Googlebot';
ModelsTest.php https://github.com/phillipmadsen/cphalcon.git | PHP | 766 lines
1<?php
2
6  +------------------------------------------------------------------------+
7  | Copyright (c) 2011-2012 Phalcon Team (http://www.phalconphp.com)       |
8  +------------------------------------------------------------------------+
13  | obtain it through the world-wide-web, please send an email             |
14  | to license@phalconphp.com so we can send you a copy immediately.       |
15  +------------------------------------------------------------------------+
15  +------------------------------------------------------------------------+
16  | Authors: Andres Gutierrez <andres@phalconphp.com>                      |
17  |          Eduar Carvajal <eduar@phalconphp.com>                         |
26
27class ModelsTest extends PHPUnit_Framework_TestCase
28{
48	{
49		if (file_exists('unit-tests/models/'.$className.'.php')) {
50			require 'unit-tests/models/'.$className.'.php';
passencrypt.php https://github.com/neymanna/fusionforge.git | PHP | 167 lines
1<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"; ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
13
14PhpWiki is free software; you can redistribute it and/or modify
15it under the terms of the GNU General Public License as published by
18
19PhpWiki is distributed in the hope that it will be useful,
20but WITHOUT ANY WARRANTY; without even the implied warranty of
24You should have received a copy of the GNU General Public License
25along with PhpWiki; if not, write to the Free Software
26Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37 * How random do you want it? See:
38 * http://www.php.net/manual/en/function.srand.php
39 * http://www.php.net/manual/en/function.mt-srand.php
126    /**
127     * http://www.php.net/manual/en/function.crypt.php
128     */
make_captcha_img.php https://github.com/spring/spring-website.git | PHP | 319 lines
1<?php
2# MantisBT - a php based bugtracking system
26	  */
27	require_once( 'core.php' );
28
44# The class below was derived from
45# http://www.phpclasses.org/browse/package/1163.html
46#
50#
51# http://www.phpclasses.org/browse.html/author/102754.html
52#
184					{
185						$size	= intval(mt_rand((int)($this->minsize / 2.3), (int)($this->maxsize / 1.7)));
186						$angle	= intval(mt_rand(0, 360));
186						$angle	= intval(mt_rand(0, 360));
187						$x		= intval(mt_rand(0, $this->lx));
188						$y		= intval(mt_rand(0, (int)($this->ly - ($size / 5))));
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21