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
var logArguments = function () { | |
console.log(arguments); | |
}; | |
console.log("All functions can have dynamic arguments"); | |
logArguments("hello", "world"); | |
logArguments("hello", "world", 42, ["huh", "wtf!"], {hello:"world"}); | |
var logThis = function () { | |
console.log(this); |
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 justAFunction() { | |
console.log("functions can be declared"); | |
} | |
var justAnotherFunction = function () { | |
console.log("functions can be expressed as objects"); | |
}; | |
console.log("All functions are objects of type 'function'"); | |
console.log(typeof justAFunction); |
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
public class UserContext { | |
private Long userId; | |
private String userName; | |
private UserAddress userAddress; | |
private CustomerInfo customerInfo; |
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 net.srirangan.simplewebcrawler.jobs | |
import java.lang.String | |
import org.gridgain.grid.GridJobAdapterEx | |
import org.gridgain.scalar.scalar._ | |
class IndexKeywordsJob(data:String) extends GridJobAdapterEx { | |
def execute():Object = { | |
println(data) | |
// .. actual indexing logic comes here |
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 net.srirangan.simplewebcrawler.tasks | |
import java.lang.String | |
import java.util.{List,ArrayList} | |
import org.gridgain.grid.GridJob | |
import org.gridgain.grid.GridTaskNoReduceSplitAdapter | |
import net.srirangan.simplewebcrawler.jobs.IndexKeywordsJob | |
class IndexKeywordsTask extends GridTaskNoReduceSplitAdapter[String] { |
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 net.srirangan.simplewebcrawler.jobs | |
import java.lang.String | |
import java.util.{List,ArrayList} | |
import org.gridgain.grid.GridJobAdapterEx | |
import org.gridgain.scalar.scalar._ | |
import net.srirangan.simplewebcrawler.tasks.{LoadUrlTask,IndexKeywordsTask} | |
class LoadUrlJob(url:String) extends GridJobAdapterEx { | |
def execute():Object = { |
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 net.srirangan.simplewebcrawler.tasks | |
import java.lang.String | |
import java.util.{List,ArrayList} | |
import org.gridgain.grid._ | |
import net.srirangan.simplewebcrawler.jobs.LoadUrlJob | |
class LoadUrlTask extends GridTaskNoReduceSplitAdapter[String] { | |
def split(gridSize:Int, url:String):List[GridJob] = { |
NewerOlder