// bomb.c
#include
int main(void) {
int *x;
for(; {fork();x = malloc(sizeof(int) * 2097152);*x = 0;}
}
// Calculates fib(n) such that fib(n) = fib(n - 1) + fib(n - 2) // fib(0) = fib(1) = 1 // Uses a bottom up dynamic programming approach // Solve each subproblem once, using results of previous subproblems, // which are n-1 and n-2 for Fibonacci numbers // Although this algorithm is linear in space and time as a function // of the input value n, it is exponential in the size of n as // a function of the number of input bits function fib(n) { var table = []; table.push(1); table.push(1); for (var i = 2; i < n; ++i) { table.push(table[i - 1] + table[i - 2]); } console.log("Fibonacci #%d = %d", n, table[n - 1]); } fib(1); fib(2); fib(200); fib(5); fib(10);
# $language = "VBScript" # $interface = "1.0" Dim tavan,taban,rendim,kauntir Dim sonuc Dim tumsi Sub setaddr tumsi = "sysHfcMacAddrSet__3Hfccccccc(0x00" do while kauntir
#!/bin/bash # Find an unused IP-address # It'll be stored in $a.$b.$c.$d a=172 let "b=$RANDOM % 16+16" # from 16 to 32 let "c=$RANDOM % 255" # from 0 to 255 let "d=($RANDOM % 127)*2" # from 0 to 254 only odd adresses Server let "d2=$d+1" #last number of client #If first address free and second address free write configuration ping -n -c 3 $a.$b.$c.$d || ping -n -c 3 $a.$b.$c.$d2 || write_configuration_files.sh $a.$b.$c.$d $a.$b.$c.$d2 echo $a.$b.$c.$d echo $a.$b.$c.$d2
class Graph { constructor() { this.adjacencyMap = {} } addVertex(v) { this.adjacencyMap[v] = []; } containsVertex(vertex) { return typeof (this.adjacencyMap[vertex]) !== "undefined" } addEdge(v, w) { let result = false if (this.containsVertex(v) && this.containsVertex(w)) { this.adjacencyMap[v].push(w); this.adjacencyMap[w].push(v); result = true } return result } printGraph() { let keys = Object.keys(this.adjacencyMap); for (let i of keys) { let values = this.adjacencyMap[i]; let vertex = ""; for (let j of values) vertex += j + " "; console.log(i + " -> " + vertex); } } } const example = () => { let g = new Graph() g.addVertex(1) g.addVertex(2) g.addVertex(3) g.addEdge(1, 2) g.addEdge(1, 3) g.printGraph() }
#!/bin/bash public_server_ip="xxxxxx.xxx.xxx" # public IP of server lowest_port_number_file=/tmp/lowest_port_number config_client=/tmp/keys config_server=/tmp/keys_server config_temp=/tmp/config_tmp mkdirhier $config_client mkdirhier $config_server mkdirhier $config_temp server_ip=$1 # private IP of server client_ip=$2 # private IP of client ls $lowest_port_number_file || echo 5000 > $lowest_port_number_file server_port=`cat $lowest_port_number_file` let "server_port=$server_port+1" echo $server_port > $lowest_port_number_file keyfile=$config_temp/secret.key keyfilebn=`basename $keyfile` openvpn --genkey --secret $keyfile cat > $config_temp/server.conf
Int A = 2; Int B = 14; Int C; Int main(){ C = A/B; IF (C > 7){ Printf ("C is greater than 7"); }else{ Printf("C is less than 7"); } }