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
(function(G,O,o,g,l,e){G.GoogleAnalyticsObject=O;G[O]=function(){G[O].q.push(arguments)},G[O].q=[],G[O].l=+new Date;e=o.createElement('script'),l=o.scripts[0];e.src=g;l.parentNode.insertBefore(e,l)}(this,'ga',document,'//www.google-analytics.com/analytics.js')); | |
// ===> | |
ga('create', 'UA-XXXXXXX-Y'); | |
ga('send', 'pageview'); |
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
package stackoverflow; | |
import org.apache.lucene.analysis.Analyzer; | |
import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.StringField; | |
import org.apache.lucene.document.TextField; | |
import org.apache.lucene.index.*; | |
import org.apache.lucene.search.*; |
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
package com.example; | |
import com.wordnik.swagger.annotations.ApiParam; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; |
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
# start... | |
$ bin/elasticsearch | |
# ... with nothing | |
$ curl -XDELETE localhost:9200 | |
{"ok":true,"acknowledged":true} | |
# index document | |
$ curl -XPUT http://localhost:9200/index1/type1/id1 -d '{"title": "foo", "tags": ["bar", "baz"]}' | |
{"ok":true,"_index":"index1","_type":"type1","_id":"id1","_version":1} |
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 | |
import csv | |
import collections | |
import re | |
import json | |
import requests | |
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 | |
""" | |
A brute-force approach to solve the seventeenth quesiton of GLAT | |
More about GLAT: http://googleblog.blogspot.de/2004/09/pencils-down-people.html | |
The questoin is as follows: | |
17. Consider a function which, for a given whole number n, | |
returns the number of ones required when writing out all numbers |
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 | |
""" | |
A brute-force approach to solve the first quesiton of GLAT | |
More about GLAT: http://googleblog.blogspot.de/2004/09/pencils-down-people.html | |
The question is as follows: | |
1. Solve this cryptic equation, realizing of course that values for M and E | |
could be interchanged. No leading zeros are allowed. |
NewerOlder