Hello World
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 { Observable, Observer } from 'rxjs'; | |
function runTest(share: boolean, delay: boolean) { | |
let observable = Observable.create((observer: Observer<boolean>) => { | |
setTimeout(() => { | |
console.log('I did my expensive thingy'); | |
observer.next(true); | |
}, 1000); | |
}); |
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 MongoClient = require('mongodb').MongoClient; | |
const configService = require('./server-config-service'); | |
function randint(max) { | |
return Math.round(Math.random() * max); | |
} | |
function randomstring() { | |
const letters = 'ABCDEFHIJKLMNOPQRSTUVWXYZ'; | |
let result = ''; |
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 { Subject } = require('rxjs'); | |
const { switchMap, combineLatest, map, startWith } = require('rxjs/operators'); | |
const data = new Subject(); | |
const value = new Subject(); | |
const clicks = new Subject(); | |
const filtered = data.pipe(switchMap(data => { | |
return value.pipe(startWith(''), combineLatest(clicks.pipe(startWith(null))), map(([value, _]) => { | |
return data.filter(item => item.includes(value)); |
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 os | |
import pyarrow.filesystem as pafs | |
import pyarrow.parquet as pq | |
from pyarrow.util import implements | |
class RelativeFilesystem(pafs.FileSystem): | |
def __init__(self, basedir): | |
self.basedir = basedir |
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 pyarrow.fs as pafs | |
import pyarrow.parquet as pq | |
filesystem = pafs.LocalFileSystem() | |
subtree_filesystem = pafs.SubTreeFileSystem('C:\\', filesystem) | |
in_path = 'Users\\westpace\\in.parquet' | |
out_path = 'Users\\westpace\\out.parquet' | |
table = pq.read_table(in_path, filesystem=subtree_filesystem) |
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 socket | |
import pyarrow as pa | |
import pyarrow.ipc | |
listen = "127.0.0.1" | |
port = 56565 | |
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: |
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 <iostream> | |
#include <vector> | |
#include <arrow/api.h> | |
#include <arrow/filesystem/api.h> | |
#include <arrow/ipc/api.h> | |
arrow::Status RunMain(int argc, char **argv) { | |
std::vector<std::vector<double>> rows = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; |
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
using System; | |
using System.Globalization; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Design; | |
using Microsoft.Extensions.Configuration; | |
namespace Arena.Utilities | |
{ | |
public abstract class BaseDbContextFactory<T> : IDesignTimeDbContextFactory<T> where T : DbContext | |
{ |
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 pyarrow | |
from datetime import datetime | |
start = datetime.strptime("00:00", "%H:%M") | |
time = datetime.strptime("12:15", "%H:%M") | |
delta = time - start | |
us = int(delta.total_seconds() * 1000000) | |
print(pyarrow.array([us], type=pyarrow.int64()).cast(pyarrow.time64('us'))) | |
# <pyarrow.lib.Time64Array object at 0x7f0b7acad160> |
OlderNewer