This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b>asda</b> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function promiseAll(arr) { | |
// fill this in | |
} | |
promiseAll([Promise.resolve(1), Promise.resolve(4)]).then(resp => { | |
console.log(resp) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr1 = [3,5,8,10,15,18]; | |
var arr2 = [6,10,15,20,25]; | |
function sort(arr1, arr2) { | |
var sortedArr = []; | |
var x = y = 0; | |
while(x < arr1.length && y < arr2.length) { | |
if(arr1[x] < arr2[y]) { | |
sortedArr.push(arr1[x++]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
When changing the width and height, change the margin to a negative half sized value, and line height | |
/* | |
#centermiddle { | |
margin: -100px 0 0 -100px; | |
display: block; | |
border:1px solid red; | |
width: 200px ; | |
height: 200px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$msg = "Hello World!"; | |
for($i = 0; $i < (strlen($msg)-1)/2; $i++) { | |
$temp = $msg[$i]; | |
$msg[$i] = $msg[strlen($msg)-1-$i]; | |
$msg[strlen($msg)-1-$i] = $temp; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = [4,8,2,4,10,2,4]; | |
for(var i = 0; i < arr.length; i++) { | |
for(var z = 0; z < arr.length-i; z++) { | |
if(arr[z] > arr[z+1]) { | |
//swap | |
var temp = arr[z]; | |
arr[z] = arr[z+1] | |
arr[z+1] = temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = 1; | |
while($result <= 1024){ | |
print $result . "\n"; | |
$result = $result << 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class node { | |
public $data; | |
public $nextNode; | |
public function __construct($data, $nextNode) { | |
$this->data = $data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function node(data, next) { | |
this.data = data; | |
this.next = next; | |
} | |
function linkedlist() { | |
this.first = null; | |
} | |
linkedlist.prototype.insertNode = function(data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// declare example array to be sorted | |
$arr1 = array(4,16,32,33,49,3,2,7,4,88); | |
// sort array and print | |
print_r(mergeRec($arr1)); | |
// Recrusive mergesort function |
NewerOlder