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
cmake_minimum_required(VERSION 3.10) | |
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/arrow/cpp/cmake_modules") | |
find_package(Arrow) | |
include_directories(${ARROW_INCLUDE_DIR}) | |
MESSAGE( STATUS ${ARROW_INCLUDE_DIR}) |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import pandas as pd\n", | |
"import numpy as np" |
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
// compile with g++ -fpic -shared handle.cpp -o libhandle.so | |
#include <cstdint> | |
extern "C" { | |
using LuaHandle = uint64_t; | |
LuaHandle maybe(LuaHandle h, bool ret) { | |
if (ret) return h; | |
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
import llvmlite.ir as ir | |
import llvmlite.binding as llvm | |
from ctypes import CFUNCTYPE | |
def main(): | |
m = ir.Module() | |
func_ty = ir.FunctionType(ir.VoidType(), []) | |
i32_ty = ir.IntType(32) | |
func = ir.Function(m, func_ty, name="printer") |
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
def composable(func, contains=None): | |
class Wrapper: | |
@wraps(func) | |
def __call__(self, *args, **kwargs): | |
return func(*args, **kwargs) | |
def __getattr__(self, name): | |
if name in locals(): | |
comp = locals[name] | |
elif name in globals(): | |
comp = globals()[name] |
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 <arrow/buffer.h> | |
#include <arrow/builder.h> | |
#include <arrow/io/memory.h> | |
#include <arrow/ipc/reader.h> | |
#include <arrow/ipc/writer.h> | |
#include <arrow/memory_pool.h> | |
#include <arrow/record_batch.h> | |
#include <arrow/type.h> | |
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 <arrow/buffer.h> | |
#include <memory> | |
#include <iostream> | |
using namespace arrow; | |
using namespace std; | |
auto main(int argc, char* argv[]) -> int { | |
int64_t size = 16; | |
auto* memory = static_cast<uint8_t*>(malloc(size)); |
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 <arrow/buffer.h> | |
#include <memory> | |
#include <iostream> | |
using namespace arrow; | |
using namespace std; | |
auto main(int argc, char* argv[]) -> int { | |
auto pool_buffer = make_shared<PoolBuffer>(default_memory_pool()); | |
pool_buffer->Resize(16); |
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 <arrow/status.h> | |
#include <benchmark/benchmark.h> | |
#include <string> | |
#include <iostream> | |
using namespace arrow; | |
#define REPEAT_N(N, BODY) \ | |
for (int idx=0;idx<N;++idx) { \ | |
BODY \ |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 32, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import requests\n", | |
"import bs4\n", |
NewerOlder