This file contains hidden or 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
# coding=utf-8 | |
from gensim.models import Doc2Vec | |
from sklearn.linear_model import LogisticRegression | |
from collections import namedtuple | |
import numpy as np | |
import gensim | |
def read_sentimentDocs(): | |
SentimentDocument = namedtuple('SentimentDocument', 'words tags split sentiment') |
This file contains hidden or 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
# coding=utf-8 | |
from gensim.models import Doc2Vec | |
from sklearn.linear_model import LogisticRegression | |
from collections import namedtuple | |
import numpy as np | |
import gensim | |
def read_sentimentDocs(): | |
SentimentDocument = namedtuple('SentimentDocument', 'words tags split sentiment') |
This file contains hidden or 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
class LRUCache{ | |
private: | |
int _capacity; | |
int _len; | |
list<pair<int,int> > l; | |
map<int, list<pair<int, int> >::iterator> mp; | |
public: | |
LRUCache(int capacity) { | |
_capacity = capacity; |
This file contains hidden or 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
struct node{ | |
int key; | |
int value; | |
node* prev; | |
node* next; | |
node(int _key, int _value) { | |
key = _key; | |
value = _value; | |
prev = NULL; | |
next = NULL; |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import six | |
import os | |
if six.PY3: | |
from urllib.request import urlopen | |
else: | |
from urllib2 import urlopen |