Skip to content

Instantly share code, notes, and snippets.

@DSLituiev
DSLituiev / install_gdb_with_conda_on_mac.sh
Created April 12, 2018 14:59
installing gdb on MacOS with conda python support
# install gettext; after installation it outputs LDFLAGS and CPPFLAGS values.
brew reinstall gettext
# export gettext and conda-specific flags
export LDFLAGS="-Wl,-rpath,/Applications/anaconda3/lib/ -L/Applications/anaconda3/lib/ -L/usr/local/opt/gettext/lib"
export CPPFLAGS="-I/usr/local/opt/gettext/include"
# extract gdb
tar xvf gdb-8.1.tar.gz
cd gdb-8.1
@DSLituiev
DSLituiev / find_first_nonnegative.py
Last active September 11, 2019 03:22
find index of first non-negative value in a sorted list
def split(x):
"""return the index of the first non-negative value in a sorted list:
legend for comments:
"-" stands for negative
"+" stands for non-negative
"""
# check for corner cases:
if len(x)==0:
return 0
elif len(x)==1:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.