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
#!/bin/bash | |
# Author: Matt Mastracci ([email protected]) | |
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script | |
# licensed under cc-wiki with attribution required | |
# Remainder of script public domain | |
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm | |
if [[ $NAME = "iTerm" ]]; then | |
FILE=$(osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")") | |
else |
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
#!/bin/bash | |
# Author: Matt Mastracci ([email protected]) | |
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script | |
# licensed under cc-wiki with attribution required | |
# Remainder of script public domain | |
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm | |
if [[ $NAME = "iTerm" ]]; then | |
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` | |
else |
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 json | |
from flask import Flask, request | |
from gensim.models import KeyedVectors | |
from flask import jsonify | |
import argparse | |
import sys | |
import socket | |
import time | |
import logging |
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 split(): Unit = { | |
import org.apache.spark.SparkConf | |
import org.ansj.library.DicLibrary | |
import org.ansj.splitWord.analysis.DicAnalysis | |
import org.apache.spark.sql.{SaveMode, SparkSession} | |
val conf = new SparkConf().setAppName("HelloWorld") | |
val spark = SparkSession | |
.builder() |