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
file= new File('TIME.ALL') | |
stopwordsFile=new File('stopwords.txt') | |
/*stopwords=[] | |
stopwordsFile.eachLine { stopwords << it.toString().toUpperCase() } |
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
var myIcon = new GIcon(); | |
myIcon.image = 'markers/image.png'; | |
myIcon.printImage = 'markers/printImage.gif'; | |
myIcon.mozPrintImage = 'markers/mozPrintImage.gif'; | |
myIcon.iconSize = new GSize(64,64); | |
myIcon.shadow = 'markers/shadow.png'; | |
myIcon.transparent = 'markers/transparent.png'; | |
myIcon.shadowSize = new GSize(96,64); | |
myIcon.printShadow = 'markers/printShadow.gif'; | |
myIcon.iconAnchor = new GPoint(32,64); |
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
// HelloServer.java | |
import java.io.*; | |
import java.net.*; | |
class HelloServer { | |
public static void main(String args[]) throws Exception { | |
ServerSocket ss = new ServerSocket(12345); | |
System.out.println("Server is created."); | |
Socket s = ss.accept(); | |
PrintStream op = new PrintStream(s.getOutputStream()); | |
op.println("Hello! how do you do?"); |
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
// HelloServer.java | |
import java.io.*; | |
import java.net.*; | |
class HelloServer { | |
public static void main(String args[]) throws Exception { | |
ServerSocket ss = new ServerSocket(12345); | |
System.out.println("Server is created."); | |
Socket s = ss.accept(); | |
PrintStream op = new PrintStream(s.getOutputStream()); | |
op.println("Hello! how do you do?"); |
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 text = "Hello from Groovy!" | |
def page = new XmlSlurper(new SAXParser()).parse('http://kanchanapisek.or.th/kp6/GENERAL/encyclopedia/saranugrom.htm') | |
def data= page.depthFirst().grep{ it.name() == 'A' && [email protected]().endsWith('.htm') }.'@href' | |
def Test() | |
{ | |
data.each{ println it} | |
} |
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
class DFS { | |
def visitedNodeCounter = 0 | |
def visitor = { | |
visitedNodeCounter++ | |
} | |
def visit(node) { | |
node.acceptVisitor visitor | |
node.children.each { visit(it) } |
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 groovyx.net.http.*; | |
def getRemoteFile = { | |
try { | |
def http = new HTTPBuilder( params.url) | |
http.request(Method.GET,ContentType.TEXT) { req -> | |
headers.'User-Agent' = 'Mozilla/5.0' | |
response.success = { resp, reader -> | |
println "My response handler got response: ${resp.statusLine}" | |
println "Response length: ${resp.headers.'Content-Length'}" |
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.*; | |
import java.net.*; | |
class TCPClient { | |
public static void main(String argv[]) throws Exception | |
{ | |
String sentence; | |
String modifiedSentence; | |
Integer i=1; | |
while(true) |
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
package NAzT | |
class GMapsGeoCoder { | |
def Query="Thammasat" | |
def url | |
def jsonObj | |
void setQuery(input) | |
{ |
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package NAzT; | |
import java.util.ArrayList; | |
import net.sf.json.JSONArray; | |
import net.sf.json.JSONObject; |