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
package histogram | |
import ( | |
"testing" | |
"pgregory.net/rand" | |
) | |
const numBins = 5 |
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
" True color support | |
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 | |
let mapleader="," | |
let g:ale_disable_lsp = 1 | |
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged) | |
call plug#begin('~/.vim/plugged') | |
Plug 'ctrlpvim/ctrlp.vim' |
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 tokio::net::{TcpListener, TcpStream}; | |
use tokio::io::{Error, AsyncReadExt, AsyncWriteExt}; | |
use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf}; | |
#[tokio::main] | |
async fn main() { | |
let server = TcpListener::bind("127.0.0.1:5433").await.unwrap(); | |
tokio::task::spawn(async move { | |
loop { | |
let (socket, _) = server.accept().await.unwrap(); |
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::error::Error; | |
use std::net::{Shutdown, TcpListener, TcpStream}; | |
use std::thread::spawn; | |
fn main() { | |
let server = TcpListener::bind("127.0.0.1:15432").unwrap(); | |
for client in server.incoming() { | |
let client = client.unwrap(); | |
client.set_nodelay(true).unwrap(); |
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 async_std::prelude::*; | |
use async_std::net::{TcpListener, TcpStream}; | |
use async_std::task::spawn; | |
use futures::join; | |
use futures::stream::StreamExt; | |
#[derive(Debug)] | |
enum Direction { | |
Back, |
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; |
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
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
# -*- 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
--- 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 |
NewerOlder