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
@FXML | |
ListView<Person> personListView; | |
@Override | |
public void initialize(URL url,ResourceBundle rb){ | |
personListView.getSelectionModel().select(0); | |
} |
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
private boolean validatePath(String path){ | |
int index = path.lastIndexOf("."); | |
String ext = path.substring(index).substring(1); | |
if( ext.equals("jpeg") || ext.equals("png")) { | |
return true; | |
} | |
return 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 org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by bookstore on 17/07/19. | |
*/ | |
object Application extends App { | |
// SparkContextの生成 | |
val conf = new SparkConf() | |
// クラスタのURLを指定。localは特殊な値であり、Sparkをクラスタへ接続することなくローカルマシンの単一スレッドで動作させる。 |
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
// 外部ファイルから一行を一つの要素として読み込み | |
val lines = sparkContext.textFile("./SampleTextFile.md") | |
// 行の先頭単語と、行全体をタプルとしてペアRDDを作成 | |
val pairs = lines.map(x => (x.split(" ")(0), x)) | |
// 直接タプル値からペアRDDを作ることも可能 | |
val animal = sparkContext.parallelize(List( | |
("panda", 0), | |
("pink", 3), |
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
// ウェブアプリのルートへのマッピング | |
@RequestMapping(value = "/") | |
// 複数のリクエストに対するマッピング | |
@ResuestMapping(value = { "/", "/welcome" } ) |
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 DispatcherServletInitializer extends AbstractAnnotationConfigDispatcher { | |
@Override | |
protected String[] getServletMappings () { | |
return new String[] { "/app/*" }; | |
} | |
} |
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
// 特定の文字まで読み込む。 | |
func readBytes() { | |
bufReader, file := newBufReader() | |
for { | |
line, err := bufReader.ReadBytes('\n') | |
fmt.Print(string(line)) | |
if err == io.EOF { | |
break | |
} | |
} |
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
// デフォルトのsplitFuncを使用して行単位で読み込み | |
func readLineByScanner() { | |
reader := strings.NewReader("1234\n5678") | |
scanner := bufio.NewScanner(reader) | |
for scanner.Scan() { | |
fmt.Println(scanner.Text()) | |
} | |
} | |
// 標準で用意されているScanWords関数を利用して、単語単位で読み込み |
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 main | |
import ( | |
"net" | |
"net/http" | |
"time" | |
"bufio" | |
"io" | |
"strconv" | |
"log" |
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
// run docker container | |
docker run <container name> | |
// run docker detache mode | |
docker run -d <container name> | |
// run docker interactive mode | |
docker run -it <container name> /bin/bash | |
// run docker auto remove mode |
OlderNewer