This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Psuedocode | |
void OnSliderChange() { | |
int slider2val = Slider2.val(); | |
int slider3val = Slider3.val(); | |
float slider2proportion = slider2val / (slider2val + slider3val); | |
int totalRemaining = 180 - Slider1.val(); | |
Slider2.setValue((int) totalRemaining * slider2proportion); | |
Slider3.setValue(totalRemaining - Slider2.val()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo.card-q) | |
(def deck | |
"Given a set of cards, return a deck of those cards" | |
vector) | |
(def card | |
"Given a map of card properties, return a card with those properties" | |
identity) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.codeInspection.{LocalInspectionTool, LocalInspectionToolSession, ProblemHighlightType, ProblemsHolder} | |
import com.intellij.psiPsiElementVisitor | |
import org.jetbrains.annotations.NotNull | |
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor | |
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScMethodCall | |
class ExampleMatcher extends LocalInspectionTool { | |
@NotNull override def buildVisitor(@NotNull holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor = { | |
buildVisitor(holder, isOnTheFly) | |
} |
OlderNewer