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
/** | |
* This file is licensed to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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
/** | |
* This file is licensed to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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
mvn compile exec:java -Dexec.mainClass="MyTopology" -Dexec.args="-somekey someval" -P local |
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 java.io.IOException; | |
import java.util.*; | |
import org.apache.commons.math3.linear.*; | |
import org.apache.lucene.analysis.Analyzer; | |
import org.apache.lucene.analysis.core.SimpleAnalyzer; | |
import org.apache.lucene.document.*; | |
import org.apache.lucene.document.Field.Store; | |
import org.apache.lucene.index.*; | |
import org.apache.lucene.store.*; |
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
@Grapes([ | |
@Grab('org.apache.solr:solr-solrj:4.5.0'), | |
@Grab(group='org.apache.solr', module='solr-core', version='4.5.0'), | |
@GrabExclude('org.restlet.jee:org.restlet'), | |
@GrabExclude('org.restlet.jee:org.restlet.ext.servlet'), | |
]) | |
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; | |
import org.apache.solr.client.solrj.response.QueryResponse; | |
import org.apache.solr.common.SolrDocument; |
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
1. Copy solrconfig.xml to /example/solr/collection1/conf | |
2. Copy schema.xml to /example/solr/collection1/conf | |
3. (optional) If you have use special classes for geospatial copy jts.jar over to /example/solr-webapp/../WEB-INF/lib | |
4. In example directory run java -jar start.jar | |
Query: | |
#!/bin/sh | |
curl http://localhost:8983/solr/collection1/query?q=*:* | |
Update: |
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
//delete jars not wanted in war (ideally exclude in Maven or Gradle) | |
grails.war.resources = { stagingDir -> | |
delete(file:"${stagingDir}/WEB-INF/lib/my-jar-name.jar") | |
} |
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
//You can create src/main/groovy, put your script called 'myscript.groovy' in there: | |
apply plugin: 'groovy' | |
apply plugin: 'java' | |
apply plugin: 'application' | |
configurations { | |
excludeFromJar | |
compile.extendsFrom excludeFromJar | |
} |
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
.... | |
text = cell.append("text") | |
.attr("x", function(d) { return d.dx / 2; }) | |
.attr("y", function(d) { return d.dy / 2; }) | |
.attr("dy", ".35em") | |
.attr("text-anchor", "middle") | |
.style("opacity", function(d) { d.w = this.getComputedTextLength(); return d.dx > d.w ? 1 : 0; }) | |
.text(function(d) { return d.name }); | |
var temp_text = text.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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
position: relative; | |
} |
NewerOlder