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
============================ | |
** Context *** | |
============================ | |
Day 1 - meticulous, unit test TDD | |
Day 2 - refactoring | |
Day 3 - "Automated testing in the real world" or "10,000 foot dive (with some hand holding)" | |
============================ | |
** Day 3 Training objectives *** |
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
@Grab('org.spockframework:spock-core:1.1-groovy-2.4') | |
@Grab('cglib:cglib:2.2') | |
import spock.lang.Specification | |
import java.util.concurrent.ExecutorService | |
import java.util.concurrent.Executors | |
import java.util.concurrent.TimeUnit | |
class DemoThreading extends Specification { |
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
Works in Solr 5.3.0, Lucene 5.3.0 | |
Refer to Solr 101 gist to get solr working https://gist.github.com/pslusarz/7de913ac63e36e8983b8#file-gistfile1-txt | |
1. download lucene and copy the following jars into SOLR_ROOT/server/solr-webapp/WEB-INF/lib | |
- lucene-analyzers-morfologik-X.X.jar, | |
- apache-solr-analysis-extras-X.X.jar (not in lucene, but in solr/dist) | |
- morfologik-fsa-X.X.jar, | |
- morfologik-polish-X.X.jar | |
- morfologik-stemming-X.X.jar | |
2. modify SOLR_ROOT/server/solr/<core>/conf/managed-schema.xml | |
a) field type definition |
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
Works in Solr 5.3.0 | |
Core is Solr concept for a collection of documents / corpus of data. Replace <core> with your own corpus name. | |
$ bin/solr start | |
$ bin/solr create -c <core> | |
#text is not stored by default | |
$ curl -X POST -H 'Content-type:application/json' --data-binary '{ | |
"replace-field":{ | |
name: "_text_", |
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 fibSeed = [1,1] | |
def nextFib = { l -> l[-2]+l[-1] } | |
def nextFibSeed = {l -> (l << nextFib(l)).tail()} | |
def upTo = {max, l -> l[-1] > max} | |
def even = {l -> l[-2]%2 ? l[-2] : 0} | |
def sumGoodUntilDone = {series, next, done, good -> done(series) ? good(series) : good(series) + call( next(series), next, done, good)} | |
def sumFib = sumGoodUntilDone.curry(fibSeed, nextFibSeed) | |
println sumFib(upTo.curry(4000000), even) |
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
<html> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script> | |
var svg = d3.select('body').append('svg') | |
.attr("height", 200) | |
.attr("width", 200); | |
var nums = [80, 53, 125, 200, 28, 97]; | |
var bars = svg.selectAll('rect') |