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
@echo off | |
set DIR=%~dp0 | |
set LIB=%DIR%..\lib\* | |
set BIN=%DIR%..\bin | |
REM ??? | |
"%JAVA8_HOME%\bin\java" -cp "%LIB%" -Dlog4j.configurationFile="%BIN%\log4j2.xml" "org.xbib.tools.Runner" "org.xbib.tools.JDBCImporter" world-importer-config.json |
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
public class TextParser extends Parser{ | |
public TextParser(Parser successor){ | |
this.setSuccessor(successor); | |
} | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".txt")){ | |
System.out.println("A text parser is handling the file: "+fileName); |
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.util.List; | |
import java.util.ArrayList; | |
public class ChainOfResponsibilityDemo { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
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
public class JsonParser extends Parser { | |
public JsonParser(Parser successor){ | |
this.setSuccessor(successor); | |
} | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".json")){ | |
System.out.println("A JSON parser is handling the file: "+fileName); |
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
public class CsvParser extends Parser { | |
public CsvParser(Parser successor){ | |
this.setSuccessor(successor); | |
} | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".csv")){ | |
System.out.println("A CSV parser is handling the file: "+fileName); |
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
public class XmlParser extends Parser { | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".xml")){ | |
System.out.println("A XML parser is handling the file: "+fileName); | |
} | |
else{ | |
super.parse(fileName); | |
} |
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.nio.file.DirectoryStream; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
public class DirectoryFilterTest { | |
public static void main(String[] args) { | |
Path basePath = Paths.get("D:/tests"); |
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.util.*; | |
public class EnhancedCollections{ | |
public static void main(String[] args){ | |
List<Integer> counts = new ArrayList<Integer>(); | |
for(int i=1;i <= 10; i++){ | |
counts.add(i); | |
} | |
//Using external iterators | |
System.out.println("Using external iterator"); |
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
5.1,3.5,1.4,0.2,Iris-setosa | |
4.9,3.0,1.4,0.2,Iris-setosa | |
4.7,3.2,1.3,0.2,Iris-setosa | |
4.6,3.1,1.5,0.2,Iris-setosa | |
5.0,3.6,1.4,0.2,Iris-setosa | |
5.4,3.9,1.7,0.4,Iris-setosa | |
4.6,3.4,1.4,0.3,Iris-setosa | |
5.0,3.4,1.5,0.2,Iris-setosa | |
4.4,2.9,1.4,0.2,Iris-setosa | |
4.9,3.1,1.5,0.1,Iris-setosa |
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.ArrayList; | |
import java.util.List; | |
/** | |
* | |
* @author mohamed | |
*/ | |
public class NNAlgorithm { |