Skip to content

Instantly share code, notes, and snippets.

@dbadrian
dbadrian / effective_modern_cmake.md
Created November 5, 2018 21:26 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@dbadrian
dbadrian / mr_hits.py
Created November 24, 2017 11:49 — forked from bxshi/mr_hits.py
Calculate MeanRank and Hits@K using TensorFlow. From github.com/nddsg/ProjC (private repo right now)
def create_eval_ops(model_input, pred_y, all_triples, eval_triples, n_entity,
top_k, idx_1=0, idx_2=1, idx_3=2):
""" Evaluation operations for any model.
For given <h,r> predict t, idx_1 = 0, idx_2 = 1, idx_3 = 2
For given <t,r> predict h, idx_1 = 2, idx_2 = 1, idx_3 = 0
:param model_input: N by 3 matrix, each row is a h,r,t pair
:param pred_y: N by ENTITY_VOCAB matrix
:param all_triples: M by 3 matrix, contains all triples in the KG
@dbadrian
dbadrian / aaai_script.sh
Created October 19, 2017 13:36 — forked from chfritz/aaai_script.sh
This shell script produces the latex source-package of a paper as required by AAAI, in preparation for printed proceedings.
#!/bin/bash
# ----------------------------------------------------------------------
# This shell script produces the latex source-package of a paper
# as required by AAAI, in preparation for printed proceedings.
# Copyright (C) 2009 Christian Fritz "fritz at cs dot toronto dot
# edu"
#
# I thank Jorge Baier for his contributions and Shirin Sohrabi for her
# feedback that has lead to improvements to the script. Thanks also
@dbadrian
dbadrian / pacaur_install.sh
Last active March 18, 2017 18:31 — forked from tadly/pacaur_install.sh
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
# reading and understanding it :)
#
# This scripts purpose is purly to save you a few seconds on your new installation.
#
# Enjoy your time on an awesome system. Arch FTW!