SlideShare a Scribd company logo
1 of 29
Scala.js
Web
mogproject Presents
2018/04/03@ Geek Night #17
https://mogproject.com
▸ 2
▸ /
Why North Carolina?
▸
▸ : IBM, SAS, Red Hat, Cisco, ...
▸
▸
▸
▸
▸
© TripAdvisor
(1)
▸ Facility Location Problems: the p-median problem
▸ 



(p)
▸ NP
▸ Linear Programming
▸ p-median 

▸ Dr. Matthias F. Stallmann / Dr. Aissa Oudjit @ North Carolina State University
(2)
▸ IBM Watson
▸ Abstract
▸ : / IBM
▸ ICACON 2018 (5/24-26 ) 

https://www.ibm.com/solutions/education/cloudacademy/us/en/cloud_academy_conference_2018.html
▸ Shogi Playground
▸ https://play.mogproject.com/
▸ / /
▸ Shogi Playground Live!
▸ https://live.mogproject.com/
▸ /
▸ Shogi Bot
▸ https://www.facebook.com/shogibot/
▸ Facebook Messenger
Scala.js
Scala
Scala.js Scala
Shogi Bot
‣ Shogi Playground
Shogi Playground
Shogi Playground
Agenda
Shogi Playground
▸ (Firefox / Chrome /Safari ) URL 

https://play.mogproject.com
▸
▸
▸
▸
▸
Shogi Playground
▸
▸
▸ ( / )
Shogi Playground
▸ Flash
▸ : Web 

http://www.shogi.pl/level-1-shogi-course/lesson-two-the-pieces/
Shogi Playground
‣ Shogi Playground
Shogi Playground
Agenda
Shogi Playground
▸
▸ Scala
▸
▸ SAM
▸ ( )
▸
▸
▸ (SVG) ( )
Shogi Playground
Scala
▸ I/O (mog-core-scala)
▸ /
mog-core-scala
mog-frontend mog-fb-bot
mog-live
Shogi Playground Shogi Playground Live! Shogi Bot
Scala.js
Scala
ScalaScala.js
Scala.js
Scala
https://github.com/mogproject/mog-core-scala
https://github.com/mogproject/mog-frontend
https://github.com/
mogproject/mog-playground
mog-playground
Scala.js
Shogi Playground
▸ (GitHub Pages )
▸
▸ No
▸
▸ 

https://github.com/mogproject/mog-playground/wiki/Query-Parameters
Shogi Playground
USEN (Url Safe sfen-Extended Notation)
▸
▸ URL
~ ~ 1 ~ 2
[ …]
. 1 ][ 2 …] .
[
. 1 ][ 2 …] .
[
Shogi Playground
USEN (Url Safe sfen-Extended Notation)
▸
▸ -> "" ( )
▸ -> SFEN
▸ '/' -> '_', ' ' ( ) -> '.', '+' -> 'z'
▸ : lnsgk2nl_1r4gs1_p1pppp1pp_1p4p2_7P1_2P6_PP1PPPP1P_1SG4R1_LN2KGSNL.b.Bb
https://en.wikipedia.org/wiki/Shogi_notation#SFEN
Shogi Playground
USEN (Url Safe sfen-Extended Notation)
▸
▸
▸ : 1 - 1
▸ :
. 1
][ 2
…].
[
Shogi Playground
USEN (Url Safe sfen-Extended Notation)
▸
▸
▸ ( * 81 + ) * 2 + ( 1)
▸ 3 36 ([0-9a-z])
▸
▸ : 0 (1 ) 80 (9 )
▸ : 81 + ( ->10, ->11, ->12, ->13, ->9, ->14, ->15,
->8, ->2, ->3, ->4, ->5, ->6, ->7)
▸ : 0 (1 ) 80 (9 )
Shogi Playground
USEN (Url Safe sfen-Extended Notation)
▸
▸ : "i"
▸ : "r"
▸ : "t"
▸ : "p"
▸ : "j"
▸ USEN :

~0.7ku36e7bq0rs83q0io9lo4be8uc31u9us1sc7ga1im8la09o8cm20u88231s8hc46u7lw5bu7gc2jm9cm2sq6ti
bgu8pu1bs6gs6cd8uc05m5oi0dm7ls09k8ko0nabfs41cbfc30w60x1weby62xa61s21w40hbzebtc4ae10y35q2
4w2k60vubds7h88vh5as2r845v1scbj80i22rr1j441d2f20s8a4e2sq9y8boqbmmbca67s8gs1ek3xobao4wsc381
n67cb2vobim9q87ga1i4bgqboo3t6517bp092i6bi2n4bv08443k21e22f20ek3k42em.r



-> https://goo.gl/QXZJkP
Shogi Playground
JavaScript
1. jQuery / Bootstrap
2. Google APIs Client Library for JavaScript
‣ URL Shortener
3. clipboard.js
‣
4. FileSaver.js
‣
5. lz-string.js
‣ /
6. ecl_new.js
‣ ( )
Scala JS
( )
package com.mogproject.mogami.frontend.api
import org.scalajs.dom.{Element, NodeListOf}
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.|
@js.native
@JSGlobal("Clipboard")
class Clipboard(selector: String | Element | NodeListOf[Element] = js.native,
options: Clipboard.Options = js.native) extends js.Object {
def on(`type`: String, handler: js.Function): Clipboard = js.native
def destroy(): Unit = js.native
}
@js.native
@JSGlobal("Clipboard")
object Clipboard extends js.Object {
@js.native
trait Options extends js.Object {
var action: js.Function1[Element, String] = js.native
var target: js.Function1[Element, Element] = js.native
var text: js.Function1[Element, String] = js.native
}
@js.native
trait Event extends js.Object {
var action: String = js.native
var text: String = js.native
var trigger: Element = js.native
def clearSelection(): Unit = js.native
}
}
https://github.com/mogproject/mog-frontend/blob/master/src/main/scala/
com/mogproject/mogami/frontend/api/Clipboard.scala
Shogi Playground
SAM (State - Action - Model)
▸ http://sam.js.org/ by Jean-Jacques Dubray
▸
▸ V = f(M)
▸ Model(M):
▸ State(S): Model View 

Action
▸ Action(A): API 

Shogi Playground
SAM
▸ State: Model View
trait SAMState[M <: SAMModel] {
def model: M
def view: SAMView
def render(newModel: M): (SAMState[M], Option[SAMAction[M]])
}
Shogi Playground
SAM
▸ View : SAM.doAction(SomeAction(data))
class SAM[M <: SAMModel](private[this] var state: SAMState[M]){
def doAction(action: SAMAction[M]): Unit = {
val result: Option[M] = action.execute(state.model)
result match {
case Some(nextModel) =>
val (nextState, nextAction) = state.render(nextModel)
state = nextState
nextAction match {
case Some(a) => doAction(a)
case None =>
}
case None =>
}
}
}
: https://github.com/mogproject/mog-frontend/blob/master/src/main/scala/com/mogproject/mogami/frontend/sam/SAM.scala
Shogi Playground
▸
▸ 

▸ JVM / JS
▸ ( ) 

&
▸ LocalStorage
Shogi Playground
Shogi Playground
‣ Shogi Playground
Agenda
Shogi Playground
(1)
▸
▸ URI 2000
▸ / Google URL Shortener
▸
▸ ( )
▸ /
Shogi Playground
(2)
▸ ( / )
▸
▸
▸ YouTube (YouTuber !?)
▸ Scala.js 

Web
▸ / Scala
▸ JavaScript
▸ SAM ( )
Thank you!
▸ Shogi Playground



https://play.mogproject.com
▸
▸ Twitter -> https://twitter.com/mogproject
▸ GitHub Issues -> https://github.com/mogproject/mog-playground/issues

More Related Content

Similar to フロントエンド初心者の大学生が Scala.js で Web アプリを作ってみた話

ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)
ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)
ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)博宣 今村
 
Edge trends mizuno-template
Edge trends mizuno-templateEdge trends mizuno-template
Edge trends mizuno-templateshintaro mizuno
 
Tayninhcity: Bản tin Tây Ninh
Tayninhcity: Bản tin Tây NinhTayninhcity: Bản tin Tây Ninh
Tayninhcity: Bản tin Tây NinhTayninhcity
 
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...Daniel Cukier
 
Deploying DNSSEC at Scale
Deploying DNSSEC at ScaleDeploying DNSSEC at Scale
Deploying DNSSEC at ScaleCaitlin Magat
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์tatumoxlxo
 
Bản tin Bình Thuận binhthuan.city
Bản tin Bình Thuận binhthuan.cityBản tin Bình Thuận binhthuan.city
Bản tin Bình Thuận binhthuan.cityBntinBnhThunbinhthua
 
Andrew's geo media evolution
Andrew's geo media evolutionAndrew's geo media evolution
Andrew's geo media evolutionAndrew Zolnai
 
Data URIs
Data URIsData URIs
Data URIsRillus
 
What's new in Spring Batch 5
What's new in Spring Batch 5What's new in Spring Batch 5
What's new in Spring Batch 5ikeyat
 
Earth gracia noida extension article list
Earth gracia noida extension article listEarth gracia noida extension article list
Earth gracia noida extension article listnehat2f
 
Responses students self assessment
Responses   students self assessmentResponses   students self assessment
Responses students self assessmentDanijela Takač
 

Similar to フロントエンド初心者の大学生が Scala.js で Web アプリを作ってみた話 (20)

ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)
ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)
ET WEST「オープンソースを使った国産フライトコントローラ開発 プロジェクトの概要」(2017-07-13)
 
Edge trends mizuno-template
Edge trends mizuno-templateEdge trends mizuno-template
Edge trends mizuno-template
 
Tayninhcity: Bản tin Tây Ninh
Tayninhcity: Bản tin Tây NinhTayninhcity: Bản tin Tây Ninh
Tayninhcity: Bản tin Tây Ninh
 
Code Quality
Code QualityCode Quality
Code Quality
 
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
 
Deploying DNSSEC at Scale
Deploying DNSSEC at ScaleDeploying DNSSEC at Scale
Deploying DNSSEC at Scale
 
Zurag
ZuragZurag
Zurag
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์
 
機械学習と自動微分
機械学習と自動微分機械学習と自動微分
機械学習と自動微分
 
Bản tin Lâm Đồng
Bản tin Lâm ĐồngBản tin Lâm Đồng
Bản tin Lâm Đồng
 
Edge trends mizuno
Edge trends mizunoEdge trends mizuno
Edge trends mizuno
 
Bản tin Bình Thuận binhthuan.city
Bản tin Bình Thuận binhthuan.cityBản tin Bình Thuận binhthuan.city
Bản tin Bình Thuận binhthuan.city
 
Andrew's geo media evolution
Andrew's geo media evolutionAndrew's geo media evolution
Andrew's geo media evolution
 
Data URIs
Data URIsData URIs
Data URIs
 
What's new in Spring Batch 5
What's new in Spring Batch 5What's new in Spring Batch 5
What's new in Spring Batch 5
 
Earth gracia noida extension article list
Earth gracia noida extension article listEarth gracia noida extension article list
Earth gracia noida extension article list
 
Responses students self assessment
Responses   students self assessmentResponses   students self assessment
Responses students self assessment
 
Ocul emergency-presentation
Ocul emergency-presentationOcul emergency-presentation
Ocul emergency-presentation
 
Ocul emergency-presentation
Ocul emergency-presentationOcul emergency-presentation
Ocul emergency-presentation
 
Mood board
Mood boardMood board
Mood board
 

More from Yosuke Mizutani

Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph TheoryYosuke Mizutani
 
Spark GraphX で始めるグラフ解析
Spark GraphX で始めるグラフ解析Spark GraphX で始めるグラフ解析
Spark GraphX で始めるグラフ解析Yosuke Mizutani
 
はじめての CircleCI
はじめての CircleCIはじめての CircleCI
はじめての CircleCIYosuke Mizutani
 
Adtech x Scala x Performance tuning
Adtech x Scala x Performance tuningAdtech x Scala x Performance tuning
Adtech x Scala x Performance tuningYosuke Mizutani
 
ScalaにまつわるNewsな話
ScalaにまつわるNewsな話ScalaにまつわるNewsな話
ScalaにまつわるNewsな話Yosuke Mizutani
 
アドテク×Scala×パフォーマンスチューニング
アドテク×Scala×パフォーマンスチューニングアドテク×Scala×パフォーマンスチューニング
アドテク×Scala×パフォーマンスチューニングYosuke Mizutani
 

More from Yosuke Mizutani (6)

Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Spark GraphX で始めるグラフ解析
Spark GraphX で始めるグラフ解析Spark GraphX で始めるグラフ解析
Spark GraphX で始めるグラフ解析
 
はじめての CircleCI
はじめての CircleCIはじめての CircleCI
はじめての CircleCI
 
Adtech x Scala x Performance tuning
Adtech x Scala x Performance tuningAdtech x Scala x Performance tuning
Adtech x Scala x Performance tuning
 
ScalaにまつわるNewsな話
ScalaにまつわるNewsな話ScalaにまつわるNewsな話
ScalaにまつわるNewsな話
 
アドテク×Scala×パフォーマンスチューニング
アドテク×Scala×パフォーマンスチューニングアドテク×Scala×パフォーマンスチューニング
アドテク×Scala×パフォーマンスチューニング
 

Recently uploaded

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Recently uploaded (20)

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

フロントエンド初心者の大学生が Scala.js で Web アプリを作ってみた話

  • 3. Why North Carolina? ▸ ▸ : IBM, SAS, Red Hat, Cisco, ... ▸ ▸ ▸ ▸ ▸ © TripAdvisor
  • 4. (1) ▸ Facility Location Problems: the p-median problem ▸ 
 
 (p) ▸ NP ▸ Linear Programming ▸ p-median 
 ▸ Dr. Matthias F. Stallmann / Dr. Aissa Oudjit @ North Carolina State University
  • 5. (2) ▸ IBM Watson ▸ Abstract ▸ : / IBM ▸ ICACON 2018 (5/24-26 ) 
 https://www.ibm.com/solutions/education/cloudacademy/us/en/cloud_academy_conference_2018.html
  • 6. ▸ Shogi Playground ▸ https://play.mogproject.com/ ▸ / / ▸ Shogi Playground Live! ▸ https://live.mogproject.com/ ▸ / ▸ Shogi Bot ▸ https://www.facebook.com/shogibot/ ▸ Facebook Messenger Scala.js Scala Scala.js Scala Shogi Bot
  • 7. ‣ Shogi Playground Shogi Playground Shogi Playground Agenda
  • 8. Shogi Playground ▸ (Firefox / Chrome /Safari ) URL 
 https://play.mogproject.com ▸ ▸ ▸ ▸ ▸
  • 10. Shogi Playground ▸ Flash ▸ : Web 
 http://www.shogi.pl/level-1-shogi-course/lesson-two-the-pieces/
  • 11. Shogi Playground ‣ Shogi Playground Shogi Playground Agenda
  • 12. Shogi Playground ▸ ▸ Scala ▸ ▸ SAM ▸ ( ) ▸ ▸ ▸ (SVG) ( )
  • 13. Shogi Playground Scala ▸ I/O (mog-core-scala) ▸ / mog-core-scala mog-frontend mog-fb-bot mog-live Shogi Playground Shogi Playground Live! Shogi Bot Scala.js Scala ScalaScala.js Scala.js Scala https://github.com/mogproject/mog-core-scala https://github.com/mogproject/mog-frontend https://github.com/ mogproject/mog-playground mog-playground Scala.js
  • 14. Shogi Playground ▸ (GitHub Pages ) ▸ ▸ No ▸ ▸ 
 https://github.com/mogproject/mog-playground/wiki/Query-Parameters
  • 15. Shogi Playground USEN (Url Safe sfen-Extended Notation) ▸ ▸ URL ~ ~ 1 ~ 2 [ …] . 1 ][ 2 …] . [ . 1 ][ 2 …] . [
  • 16. Shogi Playground USEN (Url Safe sfen-Extended Notation) ▸ ▸ -> "" ( ) ▸ -> SFEN ▸ '/' -> '_', ' ' ( ) -> '.', '+' -> 'z' ▸ : lnsgk2nl_1r4gs1_p1pppp1pp_1p4p2_7P1_2P6_PP1PPPP1P_1SG4R1_LN2KGSNL.b.Bb https://en.wikipedia.org/wiki/Shogi_notation#SFEN
  • 17. Shogi Playground USEN (Url Safe sfen-Extended Notation) ▸ ▸ ▸ : 1 - 1 ▸ : . 1 ][ 2 …]. [
  • 18. Shogi Playground USEN (Url Safe sfen-Extended Notation) ▸ ▸ ▸ ( * 81 + ) * 2 + ( 1) ▸ 3 36 ([0-9a-z]) ▸ ▸ : 0 (1 ) 80 (9 ) ▸ : 81 + ( ->10, ->11, ->12, ->13, ->9, ->14, ->15, ->8, ->2, ->3, ->4, ->5, ->6, ->7) ▸ : 0 (1 ) 80 (9 )
  • 19. Shogi Playground USEN (Url Safe sfen-Extended Notation) ▸ ▸ : "i" ▸ : "r" ▸ : "t" ▸ : "p" ▸ : "j" ▸ USEN :
 ~0.7ku36e7bq0rs83q0io9lo4be8uc31u9us1sc7ga1im8la09o8cm20u88231s8hc46u7lw5bu7gc2jm9cm2sq6ti bgu8pu1bs6gs6cd8uc05m5oi0dm7ls09k8ko0nabfs41cbfc30w60x1weby62xa61s21w40hbzebtc4ae10y35q2 4w2k60vubds7h88vh5as2r845v1scbj80i22rr1j441d2f20s8a4e2sq9y8boqbmmbca67s8gs1ek3xobao4wsc381 n67cb2vobim9q87ga1i4bgqboo3t6517bp092i6bi2n4bv08443k21e22f20ek3k42em.r
 
 -> https://goo.gl/QXZJkP
  • 20. Shogi Playground JavaScript 1. jQuery / Bootstrap 2. Google APIs Client Library for JavaScript ‣ URL Shortener 3. clipboard.js ‣ 4. FileSaver.js ‣ 5. lz-string.js ‣ / 6. ecl_new.js ‣ ( ) Scala JS ( ) package com.mogproject.mogami.frontend.api import org.scalajs.dom.{Element, NodeListOf} import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal import scala.scalajs.js.| @js.native @JSGlobal("Clipboard") class Clipboard(selector: String | Element | NodeListOf[Element] = js.native, options: Clipboard.Options = js.native) extends js.Object { def on(`type`: String, handler: js.Function): Clipboard = js.native def destroy(): Unit = js.native } @js.native @JSGlobal("Clipboard") object Clipboard extends js.Object { @js.native trait Options extends js.Object { var action: js.Function1[Element, String] = js.native var target: js.Function1[Element, Element] = js.native var text: js.Function1[Element, String] = js.native } @js.native trait Event extends js.Object { var action: String = js.native var text: String = js.native var trigger: Element = js.native def clearSelection(): Unit = js.native } } https://github.com/mogproject/mog-frontend/blob/master/src/main/scala/ com/mogproject/mogami/frontend/api/Clipboard.scala
  • 21. Shogi Playground SAM (State - Action - Model) ▸ http://sam.js.org/ by Jean-Jacques Dubray ▸ ▸ V = f(M) ▸ Model(M): ▸ State(S): Model View 
 Action ▸ Action(A): API 

  • 22. Shogi Playground SAM ▸ State: Model View trait SAMState[M <: SAMModel] { def model: M def view: SAMView def render(newModel: M): (SAMState[M], Option[SAMAction[M]]) }
  • 23. Shogi Playground SAM ▸ View : SAM.doAction(SomeAction(data)) class SAM[M <: SAMModel](private[this] var state: SAMState[M]){ def doAction(action: SAMAction[M]): Unit = { val result: Option[M] = action.execute(state.model) result match { case Some(nextModel) => val (nextState, nextAction) = state.render(nextModel) state = nextState nextAction match { case Some(a) => doAction(a) case None => } case None => } } } : https://github.com/mogproject/mog-frontend/blob/master/src/main/scala/com/mogproject/mogami/frontend/sam/SAM.scala
  • 24. Shogi Playground ▸ ▸ 
 ▸ JVM / JS ▸ ( ) 
 & ▸ LocalStorage
  • 25. Shogi Playground Shogi Playground ‣ Shogi Playground Agenda
  • 26. Shogi Playground (1) ▸ ▸ URI 2000 ▸ / Google URL Shortener ▸ ▸ ( ) ▸ /
  • 27. Shogi Playground (2) ▸ ( / ) ▸ ▸ ▸ YouTube (YouTuber !?)
  • 28. ▸ Scala.js 
 Web ▸ / Scala ▸ JavaScript ▸ SAM ( )
  • 29. Thank you! ▸ Shogi Playground
 
 https://play.mogproject.com ▸ ▸ Twitter -> https://twitter.com/mogproject ▸ GitHub Issues -> https://github.com/mogproject/mog-playground/issues