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
| import static org.junit.Assert.*; | |
| import java.io.BufferedReader; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.Scanner; |
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
| public static Map<Character, EncodedString> buildEncodingMap(Node tree) { | |
| if(tree.left == null && tree.right == null){ | |
| return null; | |
| } | |
| Map<Character,EncodedString> map = new HashMap<Character,EncodedString>(); | |
| dfs(map,tree, new EncodedString()); | |
| return map; | |
| } | |
| private static void dfs(Map<Character,EncodedString> currentMap, Node node, EncodedString es){ |
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
| import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
| import org.apache.lucene.document.Document; | |
| import org.apache.lucene.document.Field; | |
| import org.apache.lucene.document.FieldType; | |
| import org.apache.lucene.document.StringField; | |
| import org.apache.lucene.document.TextField; | |
| import org.apache.lucene.index.DirectoryReader; | |
| import org.apache.lucene.index.IndexReader; | |
| import org.apache.lucene.index.IndexWriter; | |
| import org.apache.lucene.index.IndexWriterConfig; |
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
| import java.io.File; | |
| import java.io.IOException; | |
| import java.util.Scanner; | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
| import org.apache.lucene.document.Document; | |
| import org.apache.lucene.index.DirectoryReader; | |
| import org.apache.lucene.index.IndexReader; | |
| import org.apache.lucene.index.IndexWriter; | |
| import org.apache.lucene.index.IndexWriterConfig; |
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
| import org.apache.commons.digester3.*; | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
| import org.apache.lucene.document.Document; | |
| import org.apache.lucene.document.Field; | |
| import org.apache.lucene.document.Field.Index; | |
| import org.apache.lucene.document.FieldType; | |
| import org.apache.lucene.index.DirectoryReader; | |
| import org.apache.lucene.index.IndexReader; | |
| import org.apache.lucene.index.IndexWriter; | |
| import org.apache.lucene.index.IndexWriterConfig; |
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
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.io.Reader; | |
| import java.io.StringReader; | |
| import java.util.ArrayList; | |
| import org.apache.lucene.analysis.Analyzer; | |
| import org.apache.lucene.analysis.Analyzer.TokenStreamComponents; | |
| import org.apache.lucene.analysis.TokenStream; | |
| import org.apache.lucene.analysis.Tokenizer; |
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
| var express = require('express'); | |
| var restler = require('restler'); | |
| var app = express.createServer(express.logger()); | |
| app.all('/', function(request, response){ | |
| var accountSid = 'AC32a3c49700934481addd5ce1659f04d2'; | |
| var authToken = "{{ auth_token }}"; | |
| var client = require('twilio')(accountSid, authToken); | |
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
| void memcopy(void *dest, void *src, size_t size){ | |
| void *temp = malloc(size); | |
| int i; | |
| for(i=0; i<size; i++){ | |
| *((char*)temp+i) = *((char*)src+i); | |
| } | |
| for(i=0; i<size; i++){ | |
| *((char*)dest+i) = *((char*)temp+i); | |
| } | |
| free(temp); |
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
| http://www.linkedin.com/in/gtkesh | |
| http://goo.gl/aFipD6 | |
| http://www.quora.com/Giorgi-Tkeshelashvili | |
| https://medium.com/@gtkesh | |
| https://github.com/gtkesh |
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
| __author__ = 'gtkesh' | |
| from pprint import pprint | |
| def matrixMul(A, B): | |
| TB = zip(*B) | |
| return [[sum(ea*eb for ea,eb in zip(a,b)) for b in TB] for a in A] | |
| def pivotize(m): | |
| """Creates the pivoting matrix for m.""" |