slick-doc-ja 3.0 Slick 3.0 documentationã®æ¥æ¬èªè¨³ã§ãã ç·¨éå : GitHub - krrrr38/slick-doc-ja é£çµ¡å : @krrrr38 ä»ã®ãã¼ã¸ã§ã³ã®ããã¥ã¡ã³ã Slick 1.0 翻訳 Slick 2.0 翻訳 Slick 3.0 翻訳 API Documentation (scaladoc) Slick Core (slick) TestKit (slick-testkit) Code Generator (slick-codegen) Direct Embedding (slick-direct) (Deprecated) Slick Extensions (slick-extensions) Slick 3.0.0 documentation - 01 Introduction Permalink to Introdu
ä¹ ã ã«Play Frameworkããã£ã¦ããã¤ãã§ã«Play-Slickå°å ¥ãã¦ããã JSONãPOSTãã¦JSONãè¿ãã ãã®ç°¡åãªãµã¼ãã¹ãæ¸ãã¦ã¿ãããå¤ãªã¨ããã§ã¯ã¾ã£ãã // ã¦ãã¼ã¯ã«ãªãã¨ã¯éããªãã¯ã¨ãª val q1 = tbl.filter(_.name === name).map(_.color) val q2 = tbl.filter(_.name === name).map(_.color).take(1) // ããã¯éã q1.update("#cccccc") // ããã¯éããªã q2.update("#cccccc") æ´æ°ãããè¡ã¯ä¸è¡ãªã®ã§takeããã®ãã¾ããã£ãæ§åãå ¨é¨æ¸ãæããã®ãæ®éã ããããæ¤ç´¢æ¡ä»¶ã®æç¹ã§æ´æ°ãããè¡ããåããªãããè¨å®ãã¦ããã¨ãããã¨ãã ã¡ãªã¿ã«ãå¾è ãå®è¡ããã¨ãããªã¹ã¿ãã¯ãã¬ã¼ã¹ãåãããã ç§ã®è±èªåã§ã¯
Even though it hurts my brain a little bit, learning Scala has been a pleasurable part of my job lately. It definitely isnât for the faint-hearted but it has taught me a lot about thinking precisely about the topics of immutability and shared state. The functional mindset forces you to think mainly about input and output of functions and this training, I feel, makes me a better programmer even whe
val hello = Action { Ok("hello") } def echo = Action { request => Ok("Got [" + request.body + "]") } ãªãã対象ã®Play Frameworkã®ãã¼ã¸ã§ã³ã¯2.3.2ã ã¯ããã« Actionããããã¨ã¯ä¸è¨ã§ããã¨HTTPãªã¯ã¨ã¹ããåãåã£ã¦HTTPã¬ã¹ãã³ã¹ãè¿ããè¦ã¯ããã Play Frameworkã§ãããå®æ½ããã«ããã£ã¦HTTPãªã¯ã¨ã¹ãã¨HTTPã¬ã¹ãã³ã¹ã«è©²å½ãããã®ãå ã«æ´çãã¦ããã HTTPãªã¯ã¨ã¹ã play.api.mvc.RequestHeader play.api.mvc.Request Requestã¯RequestHeaderãç¶æ¿ãã¦ããã両è ã®éãã¯åè ãbodyãªããå¾è ã¯bodyããã¨ãããã¨ã 以ä¸ã®ããã«è¨è¿°ããéã®requestã®åã¯ãªã¯ã¨
ã¯ããã« DBï¼Schemeï¼ãã¤ã°ã¬ã¼ã·ã§ã³ãã¼ã«ã使ãã«ããã£ã¦ï¼ãããã調ã¹ããã¨ãã¾ã¨ãã¦ç½®ããã¨æãï¼ åºæ¬çã«ã¯ï¼Evolutionsã¨Flywayç¦ç¹ããã¦ã¦ã¾ãï¼ ãã®2ã¤ã®ã©ã¡ããæ¡ç¨ããã°ããããèããããã«èª¿æ»ãã¾ããï¼ å®ç¸¾ãéç¨æã®å¤±æãªã©ãããã°æãã¦ããã ããã¨å¹¸ãã§ãï¼ DBãã¤ã°ã¬ã¼ã·ã§ã³ãã¼ã«ã¨ã¯ä½ããããã®ãªã®ã DBãã¤ã°ã¬ã¼ã·ã§ã³ã¨ã¯DBMSã®ç§»è¡ããããã¨ã§ï¼ä¾ãã°MySQLããPostgreSQLã¸ç§»è¡ããã¨ãï¼ï¼ ããããµãã¼ããããã¼ã«ã®ãã¨ãæãï¼ ãã®æ©è½ã¯ï¼Railsã§ãã¡æ©ãæ¡ç¨ããããããï¼Rubyã«ã¯Migr8ã¨ããã®ãããï¼ï¼ ãããï¼èª¿ã¹ã¦ããã¨DBMSã®ç§»è¡ã¨ããæå³ãããï¼ TABLEã®Schemeãã¤ã°ã¬ã¼ã·ã§ã³ã®ãã¨ãæãã¦è¨ã£ã¦ãããã¨ããã£ãï¼ EvolutionsãFlywayãPlainãªSQLãã¡ã¤ã«ã使ã£
ç´¹ä»ãããã©ã°ã¤ã³ã«ã¤ã㦠ãã®æ稿ã§ç´¹ä»ãããã©ã°ã¤ã³ã¯ä½ãã®ãã¼ã«ãè¨èªããã¬ã¼ã ã¯ã¼ã¯ããµã¼ãã¹ãªã©ã¨integrateããé¡ã®ãã®ã¯å«ã¾ããããåä½ã§ä¾¿å©ã«æããããã§ããããã©ã°ã¤ã³ã«çµã£ã¦ç´¹ä»ãã¦ããã ï¼ã¢ã«ãã¡ãããé ï¼ A prevent pinned tabs from closing plugin - by momomo.com åºå®ããã¿ããéããããªããããã©ã°ã¤ã³ããããªãã¿ããè¤æ°éãããã¨ããã¨ééã£ã¦éãã¦ããããã¿ãã¾ã§éãã¦ãã¾ããã¨ãããããããé²ããã¨ãã§ããããã«ãªãã AceJump è¦ãã¦ããç¯å²ã§ã«ã¼ã½ã«ã移åããããå ´æã«ãµãã¨ç§»åãããããããã«ãããã©ã°ã¤ã³ãæ £ããã¨ãã¡ããã¡ãéããè¨å®ããã·ã§ã¼ãã«ããã§æ©è½ãèµ·åããã¨1æåå ¥åãæ±ããããå ¥åããã¨ãã®æåãããå ´æã«é£ã¶ããã®ã·ã§ã¼ãã«ãããç»é¢ã«è¡¨ããï¼ç»ååç §ãããã¯st
ã¯ããã« åæåï¼Java ã® enumï¼ã使ããããªãããããã§ã enum ãã¼ã¯ã¼ããç¡ãã¿ããã ãã Scala ã使ãã¯ããã Java ããã°ã©ãã«ã¨ã£ã¦ã¯ããããã ã¨ãããã¾ãã Scala ã§åæåã表ç¾ããæ¹æ³ã«ã¯ã大ããåã㦠ã·ã¼ã«ãã¯ã©ã¹ 㨠Enumeration ã®äºç¨®é¡ãããã¾ããåé¢ã ããè¦ã㨠Enumeration ã«é£ã³ã¤ããããªãã¾ãããä¸è¬çãªç¨éã«ã¯ ã·ã¼ã«ãã¯ã©ã¹ ãå¤ã使ããã¾ããä»åã¯ãã®ã·ã¼ã«ãã¯ã©ã¹ã使ã£ã¦åæåã表ç¾ããæ¹æ³ãæ¢ã£ã¦ããã¾ãããã ç®æ¬¡ ã·ã¼ã«ãã¯ã©ã¹ã使ã£ã¦ã¿ãã sealed / case object ã«ããåæå å¤ãæã£ãåæå ã¾ã¨ã ã·ã¼ã«ãã¯ã©ã¹ã使ã£ã¦ã¿ãã ã·ã¼ã«ãã¯ã©ã¹ ã¯ã次ã®ããã«å®ç¾©ãã¾ãã sealed abstract class Idol sealed 修飾åãã¤ããããã¯ã©ã¹ã¯ãåä¸
Ordered and Ordering Scalaã«ã¯2å¤ã®æ¯è¼ãæ±ãtraitãããã¾ããä¸ã¤ã¯Comparable[T]ãç¶æ¿ãã¦ããOredered[T]ãããä¸ã¤ã¯Comparator[T]ãç¶æ¿ãã¦ããOrdering[T]ã§ãã Comparable[T]ã¯java.util.ComparableãComparator[T]ã¯java.util.Comparatorã«å¯¾å¿ãã¦ãããåè ã¯compareTo(t)ããå¾è ã¯compare(t1, t2)ãæã£ã¦ãã¾ããã¤ã¾ãèªåã¨ä»ã®ãªãã¸ã§ã¯ããæ¯è¼ãããã2ã¤ã®ãªãã¸ã§ã¯ããæ¯è¼ããããã¨ããç¹ãç°ãªãã¾ãã Ordered[T]ãæ±ã£ã¦ããã¨ããã¾ã«Orderingã¸ã®å¤æã«å¤±æãããã¨ããã³ã³ãã¤ã«ã¨ã©ã¼ãåºããã¨ãããã¾ãããããã©ããæ°ã«ãªã£ãã®ã§ãä»åã¯Orderedã¨Orderingã®é¢ä¿ã調ã¹ã¦ã¿ã¾ããã A
Google ã°ã«ã¼ãã§ã¯ããªã³ã©ã¤ã³ ãã©ã¼ã©ã ãã¡ã¼ã« ãã¼ã¹ã®ã°ã«ã¼ããä½æãããããããããã©ã¼ã©ã ãã°ã«ã¼ãã«åå ããããããã¨ã§ã大å¢ã®ã¦ã¼ã¶ã¼ã¨æ å ±ã®å ±æããã£ã¹ã«ãã·ã§ã³ãè¡ããã¨ãã§ãã¾ãã
ãã¼ã ã§ããã°ã©ã ãä½ãå ´åãã³ã¼ãããã©ãã©ã ã¨ä½ãã¨åé¡ãèµ·ãã¦ãã¾ããã¡ããã°ãèµ·ããããç¬èªè§£éã§é²ãã¦ãã¾ã£ã¦åãè¿ãã®ã¤ããªããã¨ã«ãªã£ãããªã©â¦ ããã§ä»åã¯ãScalaããã¸ã§ã¯ãã«Scalariformãå°å ¥ãã¦ãèªåçã«ãã¼ã ã®ã³ã¼ããç¾ããå質ãªãã®ã«ããæ¹æ³ã解説ãã¾ãã by æ ªå¼ä¼ç¤¾ã¯ã©ãããã³ã½ããã¦ã§ã¢ é澤 ç§ä» ã³ã¼ãã®æ¸ãæ¹ããã©ãã©ã ã¨ãã°ãç£ã å¤ãã®ããã°ã©ãã¯èªåãªãã®ã³ã¼ãã®æ¸ãæ¹ãæã£ã¦ããã¨æãã¾ããããã°ã©ã ãã²ã¨ãã§ä½ã£ã¦ãããã¡ã¯ãèªåã®ã«ã¼ã«ã«å¾ã£ã¦ã³ã¼ããæ¸ãã¦ãã¦åé¡ã¯ãªãã®ã§ããããã¼ã ã§åãçµãã¨ãªãã¨ã³ã¼ãã®æ¸ãæ¹ã§åé¡ãèµ·ãããã¨ãããã¾ãã ã³ã¼ãã®æ¸ãæ¹ãéãããã§ãã°ãçããã¨ãããã¾ããä¾ãã°ãCè¨èªé¢¨ã®ã·ã³ã¿ã¯ã¹ãæã¤è¨èªã§ãAãã㯠ifâelseifâelseã®ãã¬ã¼ã¹ãæ¬ ãããªããã¨ãèªåã«ã¼ã«ã«ãã¦ã
Many people who are coming in to Scala first encounter the Option type, which may be thought of (among other things) as a type-safe null. They also encounter pattern matching as both a new and (relatively) powerful concept, but also one that is easy to understand. This leads to quite a lot of use of pattern matching and often excessively so in what I have observed. Particularly with a type as triv
scala-loggingã使ã£ã¦ã¿ã æ¦è¦ ä¾å¤ã®åãæ±ããããå ´åã«ã©ãã使ãã®ãé©åãªã®ãããããªããªã£ãã®ã§ãscala.util.control.Exceptionã¨scala.util.Tryã両ã¯ã©ã¹ã®åæ©è½ããã£ã¨ä½¿ã£ã¦ã¿ãã ååã¯scala.util.control.Exception, å¾åã¯scala.util.Tryã allCatch optã§Optionãæ»ãå¤ã« ã¨ããããallCatchã§ãã¹ã¦ã®ä¾å¤ãcatchããå¦çãæ¸ãã æãæ軽ã«ä½¿ããããªã®ãoptãä¾å¤ã ã£ããNoneãæåããã°Some(x)ãè¿ãã import scala.util.control.Exception._ def divide(x: Int, y: Int) = allCatch opt { x / y } var result = divide(0, 0) printl
2.0ããScalaã«å¯¾å¿ããWebã¢ããªéçºã®äººæ°è»½éãã¬ã¼ã ã¯ã¼ã¯ãPlayãã«ã¤ãã¦è§£èª¬ããWebã¢ããªã®ä½ãæ¹ãç´¹ä»ããå ¥éé£è¼ã â»æ¬é£è¼ãã¾ã¨ãã¦èªããKindleåãé»åæ¸ç±ãããã¾ãã Scalaï¼Play 2.0ã§Webã¢ããªéçºå ¥éï¼çµï¼ï¼ Play2ãã©ã°ã¤ã³ã®ã¤ã³ã¹ãã¼ã«ã¨ä½¿ç¨ã¨æ°è¦éçº 2.0ããScalaã«å¯¾å¿ããWebã¢ããªéçºã®äººæ°è»½éãã¬ã¼ã ã¯ã¼ã¯ãPlay frameworkãã«ã¤ãã¦è§£èª¬ããWebã¢ããªã®ä½ãæ¹ãç´¹ä»ããå ¥éé£è¼ãæçµåã¯ãPlayã使ã£ãã¢ããªã±ã¼ã·ã§ã³ãæ¡å¼µãããä»çµã¿ããã©ã°ã¤ã³ã®ä½¿ãæ¹ããã³éçºæ¹æ³ãç´¹ä»ãã¾ããï¼2014/1/28ï¼ Scalaï¼Play 2.0ã§Webã¢ããªéçºå ¥éï¼11ï¼ï¼ Play2ï¼nginx/Akka/WebSocketã§é«éåæ¹åéä¿¡ Play framework 2.xãæ¢åã®Webãµã¼ãã¼ã¨é£æº
ã¯ããã« ãã®è¨äºã§ã¯Emacsã®Ensimeã®ã¤ã³ã¹ãã¼ã«æé ãç´¹ä»ãã¾ãã使ãæ¹ãªã©ã«ã¤ãã¦ã¯å ¬å¼ã®ããã¥ã¡ã³ããåç §ãã¦ããã ããã°ã¨æãã¾ããç§ãã¤ã³ã¹ãã¼ã«ããã°ããã§ãã»ã¨ãã©ä½¿ã£ã¦ã¯ãã¾ãããããªãã¡ã¯ã¿ãªã³ã°ãã¼ã«ããããã¬ã¼ãããããã§ãã åæºå OSç°å¢ ãã®è¨äºã§ã¯Vagrantboxã®'ubuntu/trusty64'ã使ãã¾ããDiscover Vagrant Boxes Atlas by HashiCorpã«ããã¾ãã次ã®ãããªã³ãã³ããå®è¡ãã¦0Sç°å¢ãå°å ¥ãã¾ããã $ mkdir ubuntu $ cd ubuntu $ vagrant add box ubuntu/trusty64 $ vagrant init $ vagrant up # starts and provisions the vagrant environment $ vagrant
ããããä¸å¹´åãããã®ä¸æ¸ããæ¾åºã sbtçµç±ã§IntelliJãèµ·åããæ¹æ³ããã£ãããsbtã®èµ·åããããã®ã§è¾ãæ°æã¡ããã£ãã d.hatena.ne.jp ãããç´æ¥èµ·åããã°è¯ãã®ã§ã¯ãªããã¨ãããã¨ã§ã以ä¸ã®é¢æ°ã bashrc ãªã zshrc ãªãã«è¿½å ããã idea () { /Applications/IntelliJ\ IDEA\ 14.app/Contents/MacOS/idea $(cd "${1}" && /bin/pwd) } ããã¨ãã«ã¬ã³ããã£ã¬ã¯ããªã®å ´å㯠idea . ã対象ã®ãã£ã¬ã¯ããªã«ããããã¸ã§ã¯ããéãããå ´å㯠idea foo/bar ã¨ããã°èµ·åã§ããã ç¸å¯¾ãã¹ã絶対ãã¹ã«å¤æãã¦ãããªãã¨ãideaã³ãã³ãã®ãããã£ã¬ã¯ããªãå ã«èµ·åãã¦ãã¾ãã
ã¯ããã« ããã°ãã¯ï¼ çªç¶ã§ããã Scala ã«ããã fold 㨠foldLeft ã¯ã»ã¨ãã©åããã®ã ï¼ã¨æã£ã¦ãã¾ãããï¼ ã¾ããScala ã® Option#fold ã¡ã½ããã使ã£ã¦ãä½ãä¸èªç¶ã«æã£ããã¨ã¯ããã¾ãããï¼ å ã«çµè«ãè¿°ã¹ã¾ãã¨ã fold ã¡ã½ãã㨠foldLeft ã¡ã½ããã¯ç°ãªãã¾ãï¼ãã¡ãã foldRight ã¨ãéãã¾ããï¼ï¼ã ãã¡ãã£ã¨ã ãæåã«å·®ãâ¦ãçãªéãã§ã¯ãªããæ ¹æ¬çã«éãã¾ãã ãã¾ãã¾ã List#fold 㨠List#foldLeft ãï¼ä¾å¤çã«ï¼ä¼¼ããããªå®ç¾©ã§ããã¤ï¼ä¾å¤çã«ï¼ä¼¼ããããªæåãããããã誤ã£ãé説ï¼å ¨ã¦ã®foldâfoldLeftï¼ããã£ãããªãã£ããããããã§ããå°ãªãã¨ãåã¯ãScala ãæ¸ãããã«ãªã£ã¦ããããä¸å®ã®æéãå ¨ã¦ã® fold 㨠foldLeft ã¯åããã®ã ã¨èãã¦ãã¾ããã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}