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
let theArray = [5, 9, 3, 15, 41, 2, 19]; | |
function arrayShift(arr, idx) { | |
console.log("Starting array is"); | |
console.log(theArray); | |
for (let i=idx; i<arr.length - 1; ++i) { | |
console.log("Step"); | |
theArray[i] = theArray[i + 1]; | |
console.log(theArray); | |
} |
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
#include <iostream> | |
using std::cout; | |
int factorial(int n) | |
{ | |
if (n > 1) | |
return n * factorial(n -1); | |
return n; | |
} |
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
#include "stdio.h" | |
#include "stdlib.h" | |
typedef struct dyn_int_array | |
{ | |
int *base; | |
unsigned long size; | |
} dyn_int_array; | |
dyn_int_array new_dyn_int_array() |
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
#!/bin/sh | |
# pppd ip-up script for all-to-tunnel routing | |
# name of primary network interface (before tunnel) | |
PRIMARY=eth0 | |
# address of tunnel server | |
SERVER=tunnel.example.com | |
# provided by pppd: string to identify connection aka ipparam option |