- ラベル付きデータが入手できない状況を考える
- Q&Aサイトを運営する場面。今見ているページ内容と関連する情報を提示したい。
- 文書間の類似度を素早く算出することで実現する。クラスタリングを使う。
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
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.28.1-1.el7.x86_64.rpm | |
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-atk-2.26.2-1.el7.x86_64.rpm | |
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-core-2.28.0-1.el7.x86_64.rpm | |
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - | |
sudo yum install -y nodejs gcc-c++ make cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango libXScrnSaver gtk3 | |
sudo yum install -y libX11 libXcomposite libXcursor libXdamage libXext libXi libXtst cups-libs libXScrnSaver libXrandr alsa-lib pango gtk3 | |
mkdir puppeteer | |
cd puppeteer/ | |
npm install puppeteer |
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 ( | |
"context" | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/ssm" |
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, InputStream} | |
import java.net.URL | |
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential | |
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport | |
import com.google.api.client.http.javanet.NetHttpTransport | |
import com.google.api.client.json.jackson2.JacksonFactory | |
import com.google.api.services.sheets.v4.model._ | |
import com.google.api.services.sheets.v4.{Sheets, SheetsScopes} |
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 ( | |
"fmt" | |
"strings" | |
"unicode/utf8" | |
) | |
func escape(s string) string { | |
return strings.Trim(fmt.Sprintf("%q", s), "\"") |
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
>>> from string import Template | |
>>> import os | |
>>> s = Template("I am $USER") | |
>>> s.substitute(os.environ) | |
'I am potix2' |
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
/kinect2/bond | |
/kinect2/hd/camera_info | |
/kinect2/hd/image_color | |
/kinect2/hd/image_color/compressed | |
/kinect2/hd/image_color_rect | |
/kinect2/hd/image_color_rect/compressed | |
/kinect2/hd/image_depth_rect | |
/kinect2/hd/image_depth_rect/compressed | |
/kinect2/hd/image_mono | |
/kinect2/hd/image_mono/compressed |
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
#!/usr/bin/env python | |
import cv2 | |
import numpy | |
# read png image and convert the image to HSV | |
image = cv2.imread("/path/to/target.png", cv2.IMREAD_COLOR) | |
hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) | |
# detect green objects |
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
//SEE: http://keens.github.io/slide/DSLtoTagless_Final/ | |
case class Result | |
case class JSON | |
trait ScenarioSYM[T] { | |
def get(url: String): ScenarioSYM[T] | |
def post(url: Sting, data: JSON): ScenarioSYM[T] | |
def and(first: ScenarioSYM[T], second: ScenarioSYM[T]): ScenarioSYM[T] | |
def run(scenario: ScenariosSYM[T]): ScenarioSYM[T] | |
} |
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
class ConcatDFSpec extends org.specs2.mutable.Specification { | |
def concat(df: DataFrame, inputColName: String, concatColName: String, outputColName: String, dataType: DataType): DataFrame = | |
df.withColumn(outputColName, callUDF(_ ++ _, dataType, df(inputColName), df(concatColName))) | |
// val paramMap: ParamMap | |
// val inputCol: Param[String] | |
// val outputCol: Param[String] | |
// val concatCol: Param[String] | |
// concat(df, paramMap(inputCol), paramMap(outputCol), paramMap(concatCol), dataType) | |
type A = Map[String, Int] |
NewerOlder