Skip to content

Instantly share code, notes, and snippets.

View JDongian's full-sized avatar
🎯
Focusing

Joshua Dong JDongian

🎯
Focusing
View GitHub Profile
@JDongian
JDongian / Dockerfile
Created November 12, 2017 23:34
basics
# Linux usage:
#docker run -ti --rm \
# -e DISPLAY=$DISPLAY \
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# interview
FROM ubuntu:16.04
RUN apt-get update && apt-get upgrade -y
# Install important libraries.
@JDongian
JDongian / NTram.md
Last active April 17, 2017 21:03
Neural Transformation Machine for Sequence to Sequence Learning

Neural Transformation Machine for Sequence to Sequence Learning

https://arxiv.org/pdf/1506.06442v1.pdf

Background

  • NTram: Neural Transformation Machine for sequence-to-sequence learning
  • sequence-to-sequence examples: machine translation, part-of-speech labeling, dependency parsing

Machine translation approaches:

  • Encoder-Decoder (usually using RNN or CNN)
  • Automatic Alignment (bidirection RNN prepares vectors for a gating NN output, better since vector is not fixed-length)
#!/usr/bin/python3
"""Host a server that sends data specified by some JSON file.
"""
import sys
import json
import time
import socket
import base64
HOST = '' # symbolic name for all available interfaces
from timeit import timeit
from threading import Thread
from concurrent.futures import ProcessPoolExecutor
from multiprocessing import Process
def busy(n):
while n > 0:
n -= 1
@JDongian
JDongian / webtexts-310L.user.js
Created February 17, 2016 08:57
multiple choice brute force for GOV 310L homework
function isComplete(e){if(0!=e.length)return!1;for(var n=0,t=e.length;t>n;n++)if("undefined"==typeof e[n])return!1;return!0}function trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkResult(){return 0==$(".incorrect").length}function getQuestionByIndex(e){return $("form.question-set-form ul.questionset li:nth-child("+e+") ul")}function getQuestionOptions(e){return texts=[],getQuestionByIndex(e).children().slice(0,-1).each(function(e){texts.push(trim($(this).children().last().html()))}),texts}function chooseAnswer(e){e.children().last().click(),e.children().first().trigger("click")}function chooseAnswerByLabelText(e,n){var t;return console.log("STATUS: MATCHING HTML FOR: "+n.slice(0,16)+"...)"),getQuestionByIndex(e).children().slice(0,-1).each(function(){trim($(this).children().last().html())==n&&(chooseAnswer($(this)),t=$(this))}),t}function reset(){$("div.clear-answers > form > a.submit").trigger("click")}function chooseVerifyReset(e,n,t){console.log("STATUS: CHOOSING ANSWER ("+n.slice

Keybase proof

I hereby claim:

  • I am JDongian on github.
  • I am jdongian (https://keybase.io/jdongian) on keybase.
  • I have a public key whose fingerprint is F2B8 DF34 ED80 6392 C5B7 65EB 32EB 97F9 8B37 9B01

To claim this, I am signing this object:

@JDongian
JDongian / slot.c
Last active August 29, 2015 14:13
Minecraft slot (de)marshaling
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#define DIAMOND_PICKAXE 0x0116
#define FEATHER 0x0120
typedef void * slot_t;