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
drop function if exists insert_test_data(bigint,bigint,bigint); | |
create or replace function insert_test_data(bigint,bigint,bigint) returns void as $$ | |
declare | |
seq_start bigint := $1; | |
seq_end bigint := $2; | |
interval constant bigint := $3; | |
step bigint := interval; | |
begin | |
while (seq_start - 1) != seq_end loop | |
insert into products select |
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
create or replace function delete_test_data(chunk int,sleep int) returns void as $$ | |
declare | |
chunk int := $1; | |
sleep_interval int := $2; | |
deleted_rows int; | |
begin | |
while dele |
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
--- | |
- hosts: all | |
vars: | |
postgresql_datadir: /var/lib/pgsql/9.4-bdr/data | |
postgresql_upstream: 192.168.122.12 | |
postgresql_downstream: 192.168.122.13 | |
postgresql_bdr_database: bdrdemo | |
postgresql_admin_user: postgres | |
postgresql_shared_guc: | |
- { regexp: "^#?listen_addresses = .*$", guc: "listen_addresses = '*'" } |
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
--- | |
- hosts: all | |
vars: | |
postgresql_roles: | |
- { rolname: "anovikov", privileges: "LOGIN,CREATEROLE,CREATEDB", password: "qwerty" } | |
- { rolname: "vpupkin", privileges: "LOGIN", password: "12345" } | |
remote_user: root | |
tasks: |
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> | |
int main (void) { | |
int n = 0; | |
while (1) { | |
if (malloc(1<<20) == NULL) { | |
printf("malloc failure after %d MiB\n", n); | |
return 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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
#define DEFSZ 0x10000 | |
static void *glob_var; |
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> | |
void doit(int ** s , int row, int col) | |
{ | |
int i, j; | |
for (i = 0; i < row; i++){ | |
for (j = 0 ;j < col; j++) | |
printf("%d ", s[i][j]); | |
printf("\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> | |
int main() | |
{ | |
int n_rows = 10, n_cols = 20, tup_size=64; | |
char ***z; | |
z = malloc(n_rows * sizeof(char **)); | |
assert(z != NULL); |
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 <string.h> | |
#define DO_ACTIVE 1 << 0 | |
#define DO_IDLE 1 << 1 | |
#define DO_IDLE_IN_XACT 1 << 2 | |
#define DO_WAITING 1 << 3 | |
#define DO_OTHER 1 << 4 | |
int main(void) |
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 <signal.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void sig_handler(int signo) | |
{ | |
if (signo == SIGINT) { | |
printf("received SIGINT\n"); | |
exit(0); |
OlderNewer