<? // function shellsort($elements,$length) // { $elements = array(2,3,4,5,1,8,11,0); $length = count($elements); $k=0; $gap[0]=(int) ($length / 2); while($gap[$k]>1) { $k++; $gap[$k]=(int)($gap[$k-1]/2); }//end while for($i=0;$i<=$k;$i++) { $step=$gap[$i]; for($j=$step;$j=0 && $temp<$elements[$p]) { $elements[$p+$step]=$elements[$p]; $p=$p-$step; }//end while $elements[$p+$step]=$temp; }//endfor j }//endfor i // return $elements; print_r($elements); // }// end function ?> http://www.go4expert.com/forums/showthread.php?t=1255
Author Archives: jeffrin
selection sort using php
<?php $arr = array(2,3,4,5,1,8,11,0); // function selection_sort(&$arr) { $n = count($arr); for($i = 0; $i < count($arr); $i++) { $min = $i; for($j = $i + 1; $j < $n; $j++) if($arr[$j] < $arr[$min]) $min = $j; $tmp = $arr[$min]; $arr[$min] = $arr[$i]; $arr[$i] = $tmp; } // } print_r($arr); ?>
hashes.pl %(hash related)
A UNIX Command $cat hashes.pl # Simple hash constructs $fred{“with”} = “without”; $fred{“this”} = “that”; $fred{“mountain”} = “valley”; $fred{“left”} = “right”; print qq/$fred{“this”}n/; @keys = keys(%fred); print “Keys are @keysn”; # Initializer for %yard. %yard = ( red => ‘brick’, blue => ‘sky’, green => ‘grass’, yellow => ‘dandelion’ ); print “$yard{‘blue’} $yard{‘yellow’}n”; $perl hashes.pl …
songclip hazard cover oct 29 2011
[audio:http://www.beautifulwork.org/wp-content/uploads/2011/10/hazard.mp3] Audio Recorder : gnome-sound-recorder 2.91.2 Details : recorded as a wav file. Play $mplayer -nojoystick -nolirc hazard.mp3 MPlayer SVN-r33057 (C) 2000-2010 MPlayer Team Playing hazard.mp3. Audio only file format detected. Clip info: Title: Artist: Album: Year: Comment: Genre: Unknown Load subtitles in ./ ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 44100 Hz, …
insertion sort algorithm in php
<?php $numbers = array(2,3,4,5,1,8,11,0); $count = count($numbers); for($i=1;$i=0 && $numbers[$j] > $key){ $numbers[$j+1] = $numbers[$j]; $numbers[$j]= $key; $j= $j-1; } } print_r($numbers); ?>
bubble sorting using php
<?php /* bubble.php by detour@metalshell.com * * Generate random numbers then sort them. * * http://www.metalshell.com/ * */ $array_size = 250; // If you use v4.2.0 or lower uncomment this // srand((double)microtime()*1000000); // Generate $array_size random numbers to be sorted. for($x = 0; $x < $array_size; $x++) $ran[$x] = rand(0, 500); /* The bubble sort …
songclip part time lover Oct 25 2011
[audio:http://www.beautifulwork.org/wp-content/uploads/2011/10/part-time-lover.mp3] Audio Recorder : gnome-sound-recorder 2.91.2 Details : recorded as a ogg file. Play $ogg123 part_time_lover.ogg Audio Device: Advanced Linux Sound Architecture (ALSA) output Playing: part_time_lover.ogg Ogg Vorbis stream: 2 channel, 44100 Hz Done. $ MP3 Conversion : pacpl Details : $ffmpeg -i part_time_lover.ogg -ab 320k part-time-lover.mp3 File Details $file part-time-lover.mp3 part-time-lover.mp3: Audio file with …
Bug Library
[bug-library]
Procedural Language
Concept Procedural Language Explanation A computer programming language that follows, in order, a set of commands. Examples of computer procedural languages are BASIC, C, FORTRAN, and Pascal. source : http://www.computerhope.com/jargon/p/proclang.htm
strip_tags PHP API
A Programming API <?php $string= strip_tags($row[‘post_content’]); ?> An Explanation strip_tags — Strip HTML and PHP tags from a string string strip_tags ( string $str [, string $allowable_tags ] ) This function tries to return a string with all NUL bytes, HTML and PHP tags stripped from a given str. It uses the same tag stripping …