Skip to content

Instantly share code, notes, and snippets.

import requests
name = 'tfidf_benchmark'
contest = 'marco-search'
fpath = 'output'
files = {"upload": open(fpath, 'rb')}
url = 'https://models.clapresearch.com/api/submit'
requests.post(url, data={"user": name, "contest": contest},
@theSage21
theSage21 / sc.bash
Created July 10, 2018 08:25
Vim + Covim + python 3
sudo apt install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev lua5.1 liblua5.1-dev libperl-dev git
sudo apt remove vim vim-runtime gvim
git clone https://github.com/vim/vim.git
cd vim/src

title: A Rainforest in Machine Learning author: Arjoonn Sharma @ CLAP Research patat: incrementalLists: true ...

gg

@theSage21
theSage21 / mailer.py
Last active January 15, 2024 03:08
Sending Files to My Kindle From Arxiv
# encoding: utf-8
# Install: pipenv install requests bs4 --python 3
# Usage: python mailer.py https://arxiv.org/abs/1805.12076
# Always supply an arxiv ABS page!!!
import sys
import os
import smtplib
import requests
@theSage21
theSage21 / goldrush.py
Last active May 30, 2018 09:53
High load simulator based on aiohttp
import aiohttp
import asyncio
import async_timeout
from tqdm import tqdm
TIMEOUT_LIMIT = 50
async def _get(url, json, pbar):
async with aiohttp.ClientSession() as session:
for _ in range(100):
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
import os
from __future__ import print_function
import keras
import asyncio
import aiohttp
import async_timeout
headers = {}
links = [] # TODO: Populate this somehow with urls
done = asyncio.Queue()
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 2 columns:
- attr:query: '[to_entries | .[] | {"component": "rows", "data": [
{"component": "text", "args": {"tagName": "h3"}, "data": .key},
{"component": "chart", "args": {"type": "line"}, "data": {"columns": .value}}
]}]'
- data: https://gist.githubusercontent.com/theSage21/9ca3a5b55ec324599d1baea229c19e27/raw/e81c3109a2c72ad5d718f18e846d6044022e91d7/data.json
@theSage21
theSage21 / dash.yml
Last active February 12, 2018 14:55
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 3 columns:
- attr:query: '[to_entries | .[] | {"component": "rows", "data": [
{"component": "text", "args": {"tagName": "h3"}, "data": .key},
{"component": "chart", "args": {"type": "pie"}, "data": {"columns": .value}}
]}]'
- data: https://gist.githubusercontent.com/theSage21/9ca3a5b55ec324599d1baea229c19e27/raw/bd8fb11a93f7607265c38daf273184dcd0b8a83e/data.json
{
"Bananas": [1,2,3, 4, 5],
"Tofu" : [1, 1.5, 3],
}