Skip to content

Instantly share code, notes, and snippets.

View jaanli's full-sized avatar
🍉
Hungry

Jaan Altosaar Li jaanli

🍉
Hungry
View GitHub Profile
@cholland29
cholland29 / rbboxTest.m
Created July 13, 2012 21:53
Extracting data from all lines within a rectangular region drawn with rbbox
function rbboxTest
% Generating example 2-D plot
hfig = figure;
hax = axes;
xdata = 1:100;
ydata = sin(xdata);
hline = line(xdata,ydata,'Marker','o');
set(hax,'ButtonDownFcn',@OnClickAxes);
@mlgill
mlgill / ipython_nb_shell.sh
Last active July 23, 2018 04:04
Bash/Zsh functions for viewing/grepping only the input code of an IPython notebook and for clearing output cells.
# Two very basic functions for searching just the input code of an IPython notebook
# Written because I often want to search notebooks for snippets but the giant output
# of embedded encoded images makes it difficult.
# Ipython's nbconvert can be used to extract just the input, but this requires
# writing to a separate file and can be quite slow when used with large notebooks.
# Additionally, find/xargs can be used with igrep when the name of the notebook isn't known.
# icat could be used to convert an IPython notebook to a standard python file if
# the notebook does not contain whole-cell magics.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbostock
mbostock / .block
Last active November 11, 2021 01:24 — forked from mbostock/.block
Scatterplot with Shapes
license: gpl-3.0
redirect: https://observablehq.com/@d3/scatterplot-with-shapes
@luispedro
luispedro / lda.tex
Created April 5, 2011 16:29
LDA in TIKZ
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (theta) at (0,0) [circle, draw] {$\theta$};
\node (z) at (2,0) [circle, draw] {$z$};
\node (w) at (4,0) [circle, draw] {$w$};
\node (alpha) at (1,2) [circle, draw] {$\alpha$};
@ashiato45
ashiato45 / README.md
Last active June 15, 2023 16:23
Rank minimization using Nuclear norm optimization for python3 using CVXOPT

This is a small modification of [http://cvxopt.org/applications/nucnrm/] for Python3 & CVXOPT. As the comment says, this program was originally written by Z. Liu and L. Vandenberghe, and it distributed under GPL.

@mblondel
mblondel / lda_gibbs.py
Last active October 9, 2023 11:31
Latent Dirichlet Allocation with Gibbs sampler
"""
(C) Mathieu Blondel - 2010
License: BSD 3 clause
Implementation of the collapsed Gibbs sampler for
Latent Dirichlet Allocation, as described in
Finding scientifc topics (Griffiths and Steyvers)
"""
@welch
welch / installing-opencv-2.4.5-macosx-10.8.4-anaconda-1.6.0
Created September 6, 2013 19:17
How to to build OpenCV 2.4.5 from the distribution tarball using cmake, on Mac OSX 10.8.4, linked to an anaconda installation.
It is a rite of passage to post one's successful build instructions for OpenCV on a Mac
after you've tried all the other conflicting instructions out there and still failed.
brew failed for me (was this because I could never get a happy brew doctor situation?
I'll never know). macports? nope. build-from-source recipes? I didn't find one that
worked for me.
Here's what did work to build OpenCV 2.4.5 from the distribution tarball using cmake,
on Mac OSX 10.8.4, linked to an anaconda installation rather than the system python.
It is a mashup of various bits of advice out there. If you're already comfortable with
build/install from source, all you need to read is the cmake invocation in step 3 and
@mgedmin
mgedmin / StartSSL.md
Last active October 22, 2023 07:52
Free StartSSL.com SSL certificate HOWTO

How to get a free StartSSL.com SSL certificate

I'm writing this up from memory, so errors may appear.

This has been updated to use SHA256 certificates.

Start

  1. Go to http://www.startssl.com/
  2. Click on 'Control Panel'
@goldsmith
goldsmith / numpy_os_x_10_9.sh
Last active January 6, 2024 07:25
How to install Numpy and Scipy on Mac OS X Mavericks (10.9) using Pip.
# set up flags for Numpy C extentions compiling
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
export CC=gcc-4.2
export CXX="g++ -arch i386 -arch x86_64"
pip install numpy
# success!