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
void GameOfLife::split() | |
{ | |
// Strategy: | |
n_x_nodes_ = n_nodes_; | |
n_y_nodes_ = 1; | |
int workload_per_node = 0; | |
int zero_node_workload = 0; | |
int n_actual_nodes = n_nodes_; | |
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
LIFE **alloc_mass_2d(int ncolumns, int nrows, LIFE init_val) | |
{ | |
LIFE **array = (LIFE **) malloc(nrows * sizeof(LIFE *)); | |
if (array == NULL) | |
{ | |
fprintf(stderr, "out of memory\n"); | |
return NULL; | |
} | |
for (int y = 0; y < nrows; y ++) | |
{ |
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 <vector> | |
typedef int num_t; | |
std::vector<num_t> *get_prime_factors(num_t num) | |
{ | |
std::vector<num_t> *list = new std::vector<num_t>(); | |
num_t start_num = num; | |
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
#!/usr/bin/perl -w | |
use strict; | |
use warnings; | |
use utf8; | |
open FILE, "enc.txt" or die $!; | |
binmode FILE, ":utf8"; | |
my $text = 0; | |
foreach my $line (<FILE>) |
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
#!/usr/bin/perl -w | |
use strict; | |
use warnings; | |
if ($#ARGV != 2) | |
{ | |
print " Usage: trace_extract_mlt_region.pl [TRACE_FILENAME] [DUMP_FILENAME] [STORE_OPERATION_INDEX]\n"; | |
exit; | |
} |
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
#!/opt/local/bin/expect -f | |
################################ | |
# Hello, | |
# this | |
# is | |
# the | |
# bitbucket2masterhost.ru | |
# site | |
# updater | |
# called |
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
// class Node | |
field left: Ref | |
field right: Ref | |
field is_marked: Bool | |
predicate inv(node: Ref, graph: Set[Ref]) { | |
node != null | |
&& acc(node.left) | |
&& acc(node.right) | |
&& acc(node.is_marked) |
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
const N: int; | |
axiom 1 < N; | |
var a: [int]int; | |
var perm: [int]int; | |
procedure __new_perm__() returns (perm: [int]int) | |
ensures perm_ok(perm); | |
ensures (forall k: int :: 0 <= k && k < N ==> perm[k] == k); | |
{ | |
var n: int; n := 0; |
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
field next: Ref | |
field value: Int | |
predicate lseg(this: Ref, end: Ref) { | |
acc(this.value, write) && acc(this.next, write) && | |
(this.next != end ==> this.next != null && acc(lseg(this.next, end), write)) | |
} | |
function get(this: Ref, i: Int, end: Ref): Int | |
requires acc(lseg(this, end), write) |
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
field f: Ref | |
define CLOSED(nodes) | |
(forall n:Ref :: { n in nodes, n.f } n in nodes && n.f != null ==> n.f in nodes) | |
define STRUCT(nodes) | |
(forall n:Ref :: { n.f } n in nodes ==> acc(n.f)) && | |
!(null in nodes) && | |
CLOSED(nodes) |
OlderNewer