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 <stdlib.h> | |
#include <string.h> | |
#define INITIAL_SHIFT (((sizeof (long long)) - 1) * 010) | |
#define NTHREADS 64 | |
#define SWITCH_TO_INSERTION 16 | |
#define SWITCH_TO_QSORT 8192 | |
#define DO_NOT_RADIX 2626144 | |
/* |
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
import npyscreen, curses | |
class StatusWidget(npyscreen.wgwidget.Widget): | |
def update(self, clear=True): | |
if clear == True: | |
self.clear() | |
self.status = npyscreen.Textfield(self.parent, rely=self.rely, relx=0, editable=1) | |
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
import npyscreen, curses | |
class FolderTreeAction(npyscreen.MLTreeAction): | |
def __init__(self, *args, **keywords): | |
super().__init__(*args, **keywords) | |
self.F = keywords['F'] | |
def actionHighlighted(self, act_on_this, key_press): | |
self.F.get_content(act_on_this.getContent()) | |
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/python3 | |
import npyscreen, curses | |
class DividedMultiLine(npyscreen.wgwidget.Widget): | |
_subwidget = npyscreen.Textfield | |
def __init__(self, screen, values = None, **keywords): | |
super(DividedMultiLine, self).__init__(screen, **keywords) |
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/env python3 | |
import asyncio | |
import time | |
class Scheduler(object): | |
def __init__(self, tasks, graph, entrypoint): | |
self.tasks = tasks | |
self.graph = graph |
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
--- a/contrib/postgres_fdw/postgres_fdw.c | |
+++ b/contrib/postgres_fdw/postgres_fdw.c | |
@@ -451,6 +451,7 @@ static void merge_fdw_options(PgFdwRelationInfo *fpinfo, | |
const PgFdwRelationInfo *fpinfo_o, | |
const PgFdwRelationInfo *fpinfo_i); | |
+static bool postgresIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte); | |
/* | |
* Foreign-data wrapper handler function: return a struct with pointers |
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
# -*- coding: utf-8 -*- | |
# Description: example netdata python.d module | |
# Author: Put your name here (your github login) | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
import time | |
from bases.FrameworkServices.SimpleService import SimpleService | |
import psycopg2 |
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 _calculate_cache_ratio(NUMERIC, NUMERIC); | |
CREATE FUNCTION _calculate_cache_ratio(sum_blks_read NUMERIC, sum_blks_hit NUMERIC) | |
RETURNS DOUBLE PRECISION AS $$ | |
SELECT COALESCE( | |
ROUND( | |
sum_blks_read / NULLIF((sum_blks_read + sum_blks_hit), 0), | |
2), 0.0 | |
)::DOUBLE PRECISION | |
$$ LANGUAGE SQL PARALLEL SAFE; |
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
\pset pager off | |
DROP DATABASE IF EXISTS db_remote; | |
CREATE DATABASE db_remote; | |
\c db_remote | |
CREATE TABLE a AS( | |
SELECT | |
x::INT AS id_a | |
, (x % 100)::INT AS id_b |
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
use std::net::TcpListener; | |
use std::net::TcpStream; | |
use std::thread::spawn; | |
use std::io::prelude::*; | |
// mod cache; | |
// pub mod state; | |
// use state::State; |
OlderNewer