Skip to content

Instantly share code, notes, and snippets.

View erickguan's full-sized avatar

Erick Guan erickguan

View GitHub Profile
@erickguan
erickguan / Pipfile
Created December 11, 2017 10:39
Simple SPARQL query on DBpedia and Wikidata
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
ipykernel = "*"
@erickguan
erickguan / cbdb-poets-import.py
Last active January 24, 2018 11:16
Import parts of CBDB into wikidata.
#%%
from datetime import date
from sqlalchemy import create_engine
import pywikibot
from pprint import pprint
from operator import is_not
from functools import partial
from concurrent.futures import ThreadPoolExecutor
from SPARQLWrapper import SPARQLWrapper, JSON
import sys
@erickguan
erickguan / example_buffer.c
Created March 25, 2019 19:37
An example C buffer implementation
int convert_blank_to_quote(const char* source, char* dest, int64_t buffer_size)
{
--buffer_size; // the last character would be '\0'
if (buffer_size <= 0) {
return -1; // illegal argument: buffer size too small
}
int64_t i = 0;
for (const char* p = source; *p != '\0' && i < buffer_size; ++p, ++i) {
*(dest + i) = p == ' ' ? '@' : *p;
TsvHttpData-1.0
https://dumps.wikimedia.org/wikidatawiki/entities/20190429/wikidata-20190429-all.json.bz2 37397047855 253e8dfca9928c6af8bbd654bfa21745
./2018basic/bin/x86_64-darwin/tlmgr list --only-installed | cut -d ' ' -f2 | cut -d ':' -f1 | sudo tee installed_texlive_packages.txt
_ tlmgr install $(cat installed_texlive_packages.txt)
@erickguan
erickguan / gdrive.patch
Last active October 22, 2024 15:49
Concurrent list for opendal
diff --git a/core/src/raw/ops.rs b/core/src/raw/ops.rs
index d61b0f3b1b..3eb33eed46 100644
--- a/core/src/raw/ops.rs
+++ b/core/src/raw/ops.rs
@@ -107,6 +107,8 @@ pub struct OpList {
///
/// Default to `false`
version: bool,
+ /// Executor for concurrent list operations
+ executor: Option<Executor>,