Skip to content

Instantly share code, notes, and snippets.

@avidanyum
avidanyum / sentencecompression.py
Created July 7, 2018 10:18
sentence deletion invalid index
from urllib import urlopen
import json
response = urlopen('https://raw.githubusercontent.com/zhaohengyang/Generate-Parallel-Data-for-Sentence-Compression/master/sample_data/parallel_data_example.json')
# with open('sample_data/parallel_data_example.json', 'r') as fp:
# data_example
data_example = json.load(response)
print(data_example[:2])
import os
@avidanyum
avidanyum / wss-ws.js
Created January 24, 2016 14:21
after using wss and ws still having the stuck "connecting" issue
var wsServer = require('ws').Server;
var wss = new wsServer({
port: '8080',
path: 'mypath'
});
wss.on('connection', function connection(ws) {
ws.on('open', function open() {
ws.send('something');
});