Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 09 04:00
    notyy commented #222
  • Oct 09 03:59
    notyy closed #222
  • Oct 09 03:59
    notyy commented #222
  • Oct 08 20:28
    Atry commented #223
  • Oct 08 20:28

    Atry on master

    docs: fix typo Merge pull request #223 from Ja… (compare)

  • Oct 08 20:28
    Atry closed #223
  • Oct 08 20:20
    Jason-Cooke opened #223
  • Oct 07 03:30
    glmars commented #222
  • Oct 06 04:05
    notyy opened #222
  • Oct 04 11:29
    datalchemist commented #217
  • Oct 04 11:02
    datalchemist commented #217
  • Oct 04 06:58

    Atry on scalafmt

    (compare)

  • Oct 04 06:46

    Atry on master

    Run scalafmt Merge branch 'master' into scal… Merge pull request #221 from Th… (compare)

  • Oct 04 06:46
    Atry closed #221
  • Oct 04 06:46
    Atry synchronize #221
  • Oct 04 06:46

    Atry on scalafmt

    Update scalafmt to 2.0.1 Update sbt to 1.3.2 Merge pull request #215 from sc… and 2 more (compare)

  • Oct 04 06:06
    Atry commented #217
  • Oct 04 05:30
    glmars commented #217
  • Oct 04 05:09
    Atry closed #191
  • Oct 04 05:09

    Atry on master

    Update scalafmt to 2.0.1 Merge pull request #203 from sc… (compare)

Michele Sciabarra
@sciabarra
@dom override def render(): Binding[BindingSeq[Node]] =
<div id="world">
{super.render().bind}
</div>
<div></div>
How I can avoid the empty <div>
William Ho
@williamho
You can wrap the first div with Constants, which is also a BindingSeq:
Constants(<div id="world">blah</div>)
Michele Sciabarra
@sciabarra
great
THX!
杨博 (Yang Bo)
@Atry

@williamho , @sciabarra , @dom val concatenated = seq1.bind ++ seq2.bind creates new BindingSeq whenever seq1 or seq2 change.

If you want to partially update the returned BindingSeq when sources change, try for / yield instead

@dom val concatenated = {
  for {
    seq <- Constants(seq1, seq2)
    x <- seq
  } yield x
}
The behavior is important when you want to render concatenated into HTML DOM
Michele Sciabarra
@sciabarra
hm Constants does not work
how can I just get a BindingSeq with a single node?
this one does not work
@dom override def render(): Binding[BindingSeq[Node]] =
Constants(<div id="world">
{super.render().bind}
</div>)
Michele Sciabarra
@sciabarra
what is wrong also there:
@dom override def render(): Binding[BindingSeq[Node]] =
super.render().bind ++ this.video().bind
++ not found
I am a bit puzzled
杨博 (Yang Bo)
@Atry
Does it compile in sbt?
Michele Sciabarra
@sciabarra
no
/Users/msciab/Dropbox/Work/MacBookPro/Magrathea/magrathea2/client/src/main/scala/magrathea/client/world/Slides.scala:80: value ++ is not a member of com.thoughtworks.binding.Binding.BindingSeq[org.scalajs.dom.Node]
[error] super.render().bind ++
杨博 (Yang Bo)
@Atry
You can't ++ two BindingSeq. You can ++ two Seq, but it's not recommended.
杨博 (Yang Bo)
@Atry

You can do like this:

@dom def concatenated[A](seq1:BindingSeq[A], seq2:BindingSeq[A]) = {
  for {
    seq <- Constants(seq1, seq2)
    x <- seq
  } yield x
}

or

@dom def concatenated[A](seq1: Binding[BindingSeq[A]], seq2: Binding[BindingSeq[A]]) = {
  for {
    seq <- Constants(seq1, seq2)
    x <- seq.bind
  } yield x
}
Michele Sciabarra
@sciabarra
what is wrong here:
 @dom  def render(): BindingSeq[Node] = 
     Constants(<style>{stylesheet()}</style>)
杨博 (Yang Bo)
@Atry
Is stylesheer() a String?
Michele Sciabarra
@sciabarra
yes
Jose Raya
@joseraya
Hi, I have opened an issue in github but maybe here is a better place to ask: Anyone using Binding.scala with IntelliJ? It underlines all my @dom methods in red an it is very annoying
Brandon Elam Barker
@bbarker
(I plan to but haven't yet)
Jose Raya
@joseraya
Well, it is not very usable right now: http://imgur.com/a/kGYwT I hope this can be solved because it is a deal breaker to me :(
Brandon Elam Barker
@bbarker
@joseraya I believe you may be able to use ScalaTags
I can at least use ScalaTags in IntelliJ, assuming you either a) prefer the scalatags syntax or b) would be willing to use it temporarily until the problem is fixed, but I guess we can see if someone else has advice
Jose Raya
@joseraya
I'll try with scalatags, thank you :)
杨博 (Yang Bo)
@Atry
You could try Scala IDE for Eclipse, it does not show red mark @joseraya
Michele Sciabarra
@sciabarra
@joseraya I am using Intellij and it is not putting in red the @dom as long as the sbt build is correct
Jose Raya
@joseraya
That's odd because the project compiles in sbt. It also happens with the todomvc sample project. Maybe there is some setting I have to enable?
Brandon Elam Barker
@bbarker
Did you refresh the project from the build.sbt (just guessing)?
I will hopefully try it soon (in the next day) to add to the sample points
杨博 (Yang Bo)
@Atry
It's due to IntelliJ not tracking AST rewritten by macros, AFAIK
Adam Hibble
@Algomancer
DeepDarkFantasy looks brilliant. I am a deep learning engineer - so scala + neural nets is like my thing. Internally at Haitch Labs I use a torch7 wrapper with a lot of similar ideas. Thinking of switching it over to mxnet or tensorflow but I like lua and twitter has a bunch of torch+scala precedence to mirror.
雾雨魔理沙
@MarisaKirisame
Hi, developer of DeepDarkFantasy here. Feel free to PM me!
杨博 (Yang Bo)
@Atry
@Algomancer IMHO, creating neural networks in an untyped language makes little sense.
雾雨魔理沙
@MarisaKirisame
deontologic
@deontologic
Hmm. I'm also having problems with IDE support. I tried using scalatags, but can't get a simple example to complete
```<div>
  <input oninput={e: Event => name := e.currentTarget.asInstanceOf[Input].value} />
  Your input is: {name.bind}
</div>```
works fine, but removing the @dom annotation and changing the template to
div(
  input(oninput := {e: Event => name := e.currentTarget.asInstanceOf[Input].value}),
  p("Your value is: " + {name.bind})
).render
no longer works
Brandon Elam Barker
@bbarker
I have given up on Intel
Intellij for certain advanced scala features for now. Is that what you use?
deontologic
@deontologic
Yup. I investigated writing a scala plugin, but they only seem to support injecting functions and inner classes-objects into traits/classes/objects
I filed a question, but there are other macro-related questions from over a week ago that haven't received a response :(
What do you use instead? Eclipse or ensime?
Brandon Elam Barker
@bbarker
I am just starting, but am in the process of trying Eclipse since both Yang Bo and Miles Sabin seem to use it, iirc (quite unfortunate as I'm not a big fan of Eclipse's UI, but what can you do :))