This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
}); |