我使用reveal.js并在Markdown代码中编写我的幻灯片.现在我想在经典的两列文本布局中显示我的内容(文本,无序的项目符号列表甚至图像).我更喜欢在初始配置中可能更复杂的解决方案,只要在Markdown中实际写入内容仍然很容易.
由于我不想运行本地服务器,因此我在主HTML文件中写下了markdown.
更新:第一个答案表明这应该通过CSS实现.(我相应地更新了我的问题.)但是,我找不到任何描述如何使用CSS.
我正在尝试使用Typesafe的Scala Logging但无法让它打印任何调试消息.我希望Scala Logging将调试消息打印到默认屏幕,但它不起作用.一个完整的例子非常有用或具体建议改变什么也会很棒.我使用Scala 2.11.这是我做的:
我将依赖项添加到build.sbt:
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.1.0"
Run Code Online (Sandbox Code Playgroud)
即使我不确定这是否是必需的,我添加了以下行但它没有任何区别:
libraryDependencies += "com.typesafe.scala-logging" % "scala-logging-slf4j_2.11" % "2.1.2"
Run Code Online (Sandbox Code Playgroud)这是我班级基本上的样子:
import com.typesafe.scalalogging._
class MyClass extends LazyLogging {
// ...
logger.debug("Here goes my debug message.")
// ...
}
Run Code Online (Sandbox Code Playgroud)我发现了文件./src/main/resources/logback.xml,但我不确定哪个模块安装了它以及它是否相关.我将日志级别更改为"debug"而没有效果.
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="scala.slick" level="DEBUG"/>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Run Code Online (Sandbox Code Playgroud)FIDO Alliance的Universal 2nd Factor(U2F)是一种新的有前途的替代密码的方法.FIDO联盟由许多玩家组成,但到目前为止只有谷歌网站似乎支持它.我可以使用其他网站登录我的U2F令牌吗?
我有嵌套的类/对象,并希望使用SLICK在数据库中存储(和检索)它们.据我所知,使用SLICK映射投影将是关键.此外,我使用伴侣对象在嵌套对象和平面结构之间进行映射(存储在DB表中).我想做这样的事情(简化示例):
case class Foo(id: Int, myBar: Bar)
case class Bar(myInt: Int, myString: String)
object Foo {
def apply(id: Int, myInt: Int, myString: String): Foo = Foo(id, Bar(myInt, myString))
override def unapply(f: Foo) = (f.id, f.myBar.myInt, f.myBar.myString)
}
object TTable extends Table[Foo]("FOO") {
def id = column[Int]("id", O.PrimaryKey)
def myInt = column[Int]("myInt", O NotNull)
def myString = column[String]("myString", O NotNull)
def * = id ~ myInt ~ myString <> (Foo.apply _, Foo.unapply _)
def query(db: Database, id: Int): Option[Foo] = db …Run Code Online (Sandbox Code Playgroud) 我使用Finagle作为Web服务器,我想从我的应用程序逻辑返回Scala-Futures.如何将scala.concurrent.Future转换为com.twitter.util.Future,当然是以非阻塞的方式?
我正在尝试熟悉Slick 3.0和Futures(使用Scala 2.11.6).我使用基于Slick的Multi-DB Cake Pattern示例的简单代码.为什么以下代码以异常终止以及如何修复它?
import scala.concurrent.Await
import scala.concurrent.duration._
import slick.jdbc.JdbcBackend.Database
import scala.concurrent.ExecutionContext.Implicits.global
class Dispatcher(db: Database, dal: DAL) {
import dal.driver.api._
def init() = {
db.run(dal.create)
try db.run(dal.stuffTable += Stuff(23,"hi"))
finally db.close
val x = {
try db.run(dal.stuffTable.filter(_.serial === 23).result)
finally db.close
}
// This crashes:
val result = Await.result(x, 2 seconds)
}
}
Run Code Online (Sandbox Code Playgroud)
执行失败:
java.util.concurrent.RejectedExecutionException: Task slick.backend.DatabaseComponent$DatabaseDef$$anon$2@5c73f637 rejected from java.util.concurrent.ThreadPoolExecutor@4129c44c[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
at …Run Code Online (Sandbox Code Playgroud)