Skip to content

Instantly share code, notes, and snippets.

Avatar

lhchavez

View GitHub Profile
View faux_omegaup.py
#!/usr/bin/python3
import argparse
import cgi
import http.server
import itertools
import json
import os
import socketserver
import time
@lhchavez
lhchavez / omegaUp problems.ipython
Created Jan 21, 2019
omegaUp priors exploration
View omegaUp problems.ipython
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# omegaUp quality and difficulty priors\n",
"\n",
"This document explores good priors to use when estimating the problem difficulty and quality before enough actual votes are cast."
]
@lhchavez
lhchavez / omegaup_problems.csv
Created Jan 21, 2019
omegaUp problem dataset
View omegaup_problems.csv
visits submissions accepted difficulty quality quality_histogram_1 quality_histogram_2 quality_histogram_3 quality_histogram_4 quality_histogram_5 difficulty_histogram_1 difficulty_histogram_2 difficulty_histogram_3 difficulty_histogram_4 difficulty_histogram_5
0 0 0 0.0
0 56 7 0.0
0 27 10 0.0
0 1097 261 0.0
0 7 1 0.0
0 23 2 0.0
1 45 6 1.56738734117549 3.27889384186382 0 0 0 1 1 0 0 2 0 0
0 3 1 0.0
0 65 35 0.0
@lhchavez
lhchavez / process.py
Created Aug 3, 2018
Obtener los issues de GitHub
View process.py
#!/usr/bin/python3
import json
import os
import subprocess
import sys
def download(page):
print(page, file=sys.stderr)
subprocess.check_call([
@lhchavez
lhchavez / Makefile
Created Jun 15, 2018
quark Makefile
View Makefile
golangfiles:=$(shell find src/github.com/omegaup/quark -name '*.go')
assetfiles:=$(shell find src/github.com/omegaup/quark/cmd/omegaup-grader/data/dist)
all: bin/omegaup-grader bin/omegaup-broadcaster bin/omegaup-runner
bin/go-bindata:
go get -u github.com/jteeuwen/go-bindata/...
bin/golint:
go get -u golang.org/x/lint/golint
@lhchavez
lhchavez / adbddb.cpp
Created Jan 19, 2018
Android Debug Bridge Debugger
View adbddb.cpp
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/usbdevice_fs.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstdio>
#include <iostream>
@lhchavez
lhchavez / mkns.cpp
Created Oct 22, 2017
Create namespaces and bind their nsfs FDs
View mkns.cpp
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
@lhchavez
lhchavez / ClangIwyu.cpp
Created Jan 3, 2017
WIP of an IWYU ClangTool
View ClangIwyu.cpp
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Path.h"
View test_cast.cpp
// Benchmark Time CPU Iterations
// -----------------------------------------------------
// BM_DynamicCast 1073 ns 1074 ns 630631
// BM_StaticCast 452 ns 452 ns 1552106
// BM_TaggedCast 59 ns 59 ns 11111111
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <benchmark/benchmark.h>
View adb.py
#!/usr/bin/python3
from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA
import argparse
import socket
import struct
import sys
ADB_AUTH_TOKEN = 1
You can’t perform that action at this time.