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
from falkordb import FalkorDB | |
# Connect to FalkorDB | |
db = FalkorDB(host='localhost', port=6379) | |
# Select the social graph | |
g = db.select_graph('social') | |
# Create index | |
try: |
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/bash | |
VERSION_H=./src/version.h | |
MAJOR=99 | |
MINOR=99 | |
PATCH=99 | |
DRYRUN=echo | |
read -r -p "dryrun? [Y/n]" input | |
if [ "$input" == "n" ]; then |
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 <assert.h> | |
#include <stdio.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
pthread_rwlock_t rwlock; | |
void* writer(void *arg) { | |
printf("in writer thread, trying to acquire write lock\n"); | |
pthread_rwlock_wrlock(&rwlock); |
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 a new matrix iterator | |
GrB_Info GxB_MatrixTupleIter_new | |
( | |
GxB_MatrixTupleIter **iter, // iterator to create | |
GrB_Matrix A // matrix being iterated | |
) ; | |
// Iterate over specific row | |
GrB_Info GxB_MatrixTupleIter_iterate_row | |
( |
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
# | |
# Redis malloc | |
# | |
# Pull base image. | |
FROM ubuntu:14.04 | |
# Install. | |
RUN \ | |
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ |
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
// ExecutionPlan.c | |
function Query_Execute() { | |
/* Set an exception-handling breakpoint to capture run-time errors. | |
* encountered_error will be set to 0 when setjmp is invoked, and will be nonzero if | |
* a downstream exception returns us to this breakpoint. */ | |
QueryCtx *ctx = pthread_getspecific(_tlsQueryCtxKey); | |
if(!ctx->breakpoint) ctx->breakpoint = rm_malloc(sizeof(jmp_buf)); | |
int encountered_error = setjmp(*ctx->breakpoint); | |
if(encountered_error) { |
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 Query_Execute() { | |
/* Call ExecutionPlan_Execute on a different thread | |
* and wait for it to exit */ | |
char *error = NULL; | |
pthread_t thread; | |
pthread_create(&thread, NULL, ExecutionPlan_Execute, NULL); | |
pthread_join(thread, &error); | |
if(error != NULL) { | |
// Exception been thrown. |
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 A() { | |
jump there; // Can't jump outside of current scope. | |
} | |
function B() { | |
there: | |
... | |
} |
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
try { | |
// Perform work which might throw an exception | |
work(); | |
} catch (error *e) { | |
reportError(e); | |
} |
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
try { | |
// Perform work which might throw an exception | |
work(); | |
} catch (error *e) { | |
reportError(e); | |
} |
NewerOlder