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 alpine:3.7 | |
COPY rootfs / | |
RUN apk --update add --no-cache \ | |
curl=7.61.1-r2 \ | |
openvpn=2.4.4-r1 \ | |
supervisor \ | |
openssh |
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
for(int i = 0; i < reader.maxDoc(); i++){ | |
if(((DirectoryReader) reader).isCurrent()){ | |
Document document = reader.document(i); | |
String source = document.getBinaryValue("_source").utf8ToString(); | |
System.out.println(source); | |
} | |
} |
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
import org.apache.lucene.index.DirectoryReader; | |
import org.apache.lucene.index.IndexReader; | |
import org.apache.lucene.store.Directory; | |
import org.apache.lucene.store.FSDirectory; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
String luceneIndexPath = "my-elasticsearch/data/nodes/0/indices/eCCAJ-x6SOuN6w7vqr4tGQ/0/index"; | |
Directory index = FSDirectory.open(Paths.get(luceneIndexPath)); |
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
public static String getKeyword(String msg, ArrayList<String> keywordList){ | |
for(String key : keywordList){ | |
if(msg.toLowerCase().contains(key.toLowerCase())){ | |
return key; | |
} | |
} | |
return ""; | |
} |
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
def sigmoid(X): | |
return 1 / (1 + (e ** (-1*X))) | |
def gradient(theta, x, y): | |
grad = np.zeros(theta.shape).flatten() | |
m = y.size | |
h = sigmoid(x.dot(theta)) | |
for jth in range(x.shape[1]): | |
xjth = x[:, jth] |