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
/* | |
* Copyright (c) 2009-2017, Peter Abeles. All Rights Reserved. | |
* | |
* Translated from Java to Scala by Andrew Watson, Jan 2018. | |
* | |
* This file is part of Efficient Java Matrix Library (EJML). | |
* | |
* Licensed 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 |
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.Collection; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.ArrayList; | |
import java.lang.reflect.Array; | |
import java.util.Iterator; | |
// this class has two constructors: | |
// 1. takes a generic array and assigns it to a generic array | |
// 2. takes a generic collection and assigns it to a "generic" array |
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
##---------------------------------------------------------------------------- | |
## | |
## functions to find and replace within multiple files or in file names | |
## | |
##---------------------------------------------------------------------------- | |
# if dir, return dir; if symlink, return dir that symlink points to | |
function unsym(){ | |
echo "$(python -c "import os; print(os.path.realpath('"$1"'))")" | |
} |
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 | |
setlocal enabledelayedexpansion | |
set first=1 | |
set tmpFile=merged.csv.tmp | |
set outFile=merged.csv | |
if exist "%tmpFile%" del "%tmpFile%" | |
if exist "%outFile%" del "%outFile%" |
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 | |
setlocal enabledelayedexpansion | |
set row=0 | |
set inFile=merged.csv | |
set outFile=final.csv | |
if exist "%outFile%" del "%outFile%" |
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.ArrayList; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class SimplestCSVParser { | |
// private constructor -- utility class | |
private SimplestCSVParser(){} | |
// where the magic happens |
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.BufferedInputStream; | |
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.io.IOException; | |
// NOTE: adapted from http://bit.ly/2LOQwIP | |
public class CountLines { | |
// private constructor in utility class |
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.File; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.RandomAccessFile; | |
import org.apache.poi.ss.usermodel.Cell; | |
import org.apache.poi.ss.usermodel.DataFormatter; | |
import org.apache.poi.ss.usermodel.FormulaEvaluator; | |
import org.apache.poi.ss.usermodel.Row; | |
import org.apache.poi.ss.usermodel.Sheet; |
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.FileInputStream; | |
import java.io.IOException; | |
import java.util.Properties; | |
// Compile and then run! Change the settings.conf file and rerun without recompiling! | |
// Settings are updated without needing to recompile. | |
public class Settings { | |
public static boolean DEBUG = false; |
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.BufferedReader; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class Entries { | |
public static void main (String[] args) { |