Skip to content

Instantly share code, notes, and snippets.

CMakeFiles/ccls.dir/src/clang_complete.cc.o: In function `ccls::PreambleStatCache::Producer(llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)::VFS::openFileForRead(llvm::Twine const&)':
clang_complete.cc:(.text._ZZN4ccls17PreambleStatCache8ProducerEN4llvm18IntrusiveRefCntPtrIN5clang3vfs10FileSystemEEEEN3VFS15openFileForReadERKNS1_5TwineE[_ZZN4ccls17PreambleStatCache8ProducerEN4llvm18IntrusiveRefCntPtrIN5clang3vfs10FileSystemEEEEN3VFS15openFileForReadERKNS1_5TwineE]+0x68): undefined reference to `llvm::Twine::str[abi:cxx11]() const'
CMakeFiles/ccls.dir/src/clang_complete.cc.o: In function `ccls::PreambleStatCache::Producer(llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)::VFS::status(llvm::Twine const&)':
clang_complete.cc:(.text._ZZN4ccls17PreambleStatCache8ProducerEN4llvm18IntrusiveRefCntPtrIN5clang3vfs10FileSystemEEEEN3VFS6statusERKNS1_5TwineE[_ZZN4ccls17PreambleStatCache8ProducerEN4llvm18IntrusiveRefCntPtrIN5clang3vfs10FileSystemEEEEN3VFS6statusERKNS1_5TwineE]+0x68): undefined reference to `llvm::Twine::s
import os
import pwd
# Utility functions
def get_owner(file_path):
return pwd.getpwuid(os.stat(file_path).st_uid).pw_name
with open(path) as f:
f = defaultdict(int)
for line in f:
line = line.split()
label = line[0]
for attr in line[1:]:
// '1:1'
index, value = attr.split(':')
key = (label, index, value)
f[key] += 1
with open('bc-test') as f:
data = []
for line in f:
line = line.split()
label = line[0]
# map attrs to list of (index, value) pairs
attrs = [ t.split(':') for t in line[1:] ]
data.append([label] + attrs)
@wcwagner
wcwagner / App.js
Created March 31, 2017 02:00
App.js react-md autocomplete
import React, { Component, PureComponent } from 'react';
import Fuse from 'fuse.js';
import Autocomplete from 'react-md/lib/Autocompletes';
import SelectionControlGroup from 'react-md/lib/SelectionControls/SelectionControlGroup';
const programmingLanguages = [
'CSS',
'C++',
'C',
@wcwagner
wcwagner / kth_smallest
Created November 1, 2016 17:35
230. Kth Smallest Element in a BST
class Solution(object):
def kthSmallest(self, root, k):
"""
:type root: TreeNode
:type k: int
:rtype: int
"""
global k_
global kth_smallest_val
k_ = k
@wcwagner
wcwagner / strings.py
Created July 16, 2016 23:42
Attempt to fix #13598
import numpy as np
from pandas.compat import zip
from pandas.core.common import (isnull, notnull, _values_from_object,
is_bool_dtype,
is_list_like, is_categorical_dtype,
is_object_dtype, is_string_like)
from pandas.core.algorithms import take_1d
import pandas.compat as compat
from pandas.core.base import AccessorProperty, NoNewAttributesMixin