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
FilenameFilter fileFilter = new SuffixFileFilter(".html"); | |
File resultDir = new File(testPath); | |
String[] results = resultDir.list(fileFilter); | |
for (int i = 0; i < results.length; i++) { | |
System.out.println(results[i]); | |
} |
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
// Print all of the news items on hackernews | |
var jsdom = require('jsdom'); | |
jsdom.env({ | |
html: 'http://news.ycombinator.com/', | |
scripts: [ | |
'http://code.jquery.com/jquery-1.5.min.js' | |
], | |
done: function(errors, window) { | |
var $ = window.$; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<artifactId>harp</artifactId> | |
<groupId>com.bskyb</groupId> | |
<version>1.0-SNAPSHOT</version> | |
</parent> | |
<groupId>org.hello</groupId> | |
<artifactId>hello-connector</artifactId> |
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 javax.xml.XMLConstants | |
import javax.xml.transform.stream.StreamSource | |
import javax.xml.validation.SchemaFactory | |
class jasonXsdValdation { | |
static def xml = """ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<jason> |
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 static groovyx.gpars.GParsExecutorsPool.withPool | |
def restUrl = ["http://url1", "http://url2", "http://url3"] | |
def poolSize =restUrl.length | |
withPool(poolSize) { | |
poolSize.times { | |
Closure callUrl = {"http://google.com".toURL().withReader {}} | |
callUrl.callAsync(); | |
} |