전체 글
-
spark log level 조정하기spark 2022. 1. 30. 20:16
문제 spark 을 local mode 로 실행할 때, 로그가 아래처럼 너무 많아 출력결과를 살펴보기가 어렵다. Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties 22/01/30 20:11:12 INFO SparkContext: Running Spark version 3.0.0 22/01/30 20:11:13 INFO ResourceUtils: ============================================================== 22/01/30 20:11:13 INFO ResourceUtils: Resources for spark.driver: 22/01/30 20:11:13 INFO ..
-
완성 - 메뉴 구현web/laminar 2022. 1. 29. 10:30
문제 Waypoint 를 이용해 Router 적용 코드에 fomantic-ui menu 를 적용해 본다. http://localhost:9000/search?engine=google&query=bts 입력 했을 때 http://localhost:9000/login 입력 했을 때 코드 import com.raquo.laminar.api.L import com.raquo.laminar.api.L._ import com.raquo.laminar.nodes.ReactiveHtmlElement import com.raquo.waypoint._ import org.scalajs.dom import org.scalajs.dom.html import upickle.default._ class Radio(name: St..
-
Waypoint 를 이용해 Router 적용web/laminar 2022. 1. 28. 20:36
문제 Waypoint 를 이용해 Router 를 적용해 본다. http://localhost:9000/search?engine=google&query=bts 입력 했을 때 google 이 선택 체크되고, Search Query 에 bts 가 입력된 화면이 노출되어야 한다. 사용자가 Search Engine 으로 naver 를 선택 체크하고, Search Query 로 iphone 을 입력후 submit 버튼을 눌렀을 때 브라우저 URL 이 http://localhost:9000/search?engine=naver&query=iphone 로 변경되어야 한다. http://localhost:9000/login 입력 했을 때 코드 import com.raquo.laminar.api.L import com.ra..
-
디렉토리 목록을 정렬 후 상위 N 개의 디렉토리만 남기고 모두 삭제하기bash 2022. 1. 21. 21:27
문제 아래와 같이 backup 디렉토리에 날짜 이름으로 5개의 하위 디렉토리가 있다. 이름순으로 정렬했을 때 가장 최근 디렉토리 2개(20220104, 20220105)만 남기고 모두 삭제하고 싶다. windbird@AL01929730:~$ ls -l ./backup total 20 drwxr-xr-x 2 windbird windbird 4096 Jan 21 21:14 20220101 drwxr-xr-x 2 windbird windbird 4096 Jan 21 21:14 20220102 drwxr-xr-x 2 windbird windbird 4096 Jan 21 21:14 20220103 drwxr-xr-x 2 windbird windbird 4096 Jan 21 21:14 20220104 drwxr-x..
-
children 으로 List 표현하기web/laminar 2022. 1. 20. 21:54
코드 import com.raquo.laminar.api.L._ import org.scalajs.dom object Main { def main(args: Array[String]): Unit = { val list: Var[List[String]] = Var(List("a", "bc", "def")) val content = div( ol( children li(item))) ) ) val containerNode = dom.document.getElementById("main_content") render(containerNode, content) } } 설명 다음과 같은 Html 이 생성된다. a bc def
-
Observer 를 사용해 side effect 처리하기web/laminar 2022. 1. 9. 22:48
코드 import com.raquo.laminar.api.L._ import org.scalajs.dom import org.scalajs.dom.MouseEvent object Main { def main(args: Array[String]): Unit = { val observer = Observer[MouseEvent](_ => println("button clicked")) val testButton = button("test", onClick --> observer) // 혹은 아래처럼 한줄로 표현하는 것도 가능하다. // val testButton = button("test", onClick --> {_ => println("button clicked")}) val content = div( ..
-
Component - TextInputweb/laminar 2022. 1. 9. 22:23
문제 laminar 와 fomantic-UI 의 Input 을 이용해, 재활용 가능한 component 를 만들어 보자 코드 import com.raquo.laminar.api.L._ import com.raquo.laminar.nodes.ReactiveHtmlElement import org.scalajs.dom import org.scalajs.dom.html object Main { class TextInput(name: String, description: String) { val textVar: Var[String] = Var("") val elem: ReactiveHtmlElement[html.Div] = div( label(name), cls := "ui input", input( typ :..
-
Component - Radioweb/laminar 2022. 1. 9. 22:08
문제 laminar 와 fomantic-UI 의 Radio 를 이용해, 재활용 가능한 component 를 만들어 보자 코드 import com.raquo.laminar.api.L._ import com.raquo.laminar.nodes.ReactiveHtmlElement import org.scalajs.dom import org.scalajs.dom.html object Main { class Radio(name: String, items: Seq[String]) { val selectedVar: Var[String] = Var("") val elem: ReactiveHtmlElement[html.Div] = div( cls := "ui form", div( cls := "inline fields"..