Skip to content

Instantly share code, notes, and snippets.

View keki's full-sized avatar

Balazs Keki keki

  • SevenEight Capital
  • Budapest
  • 11:30 (UTC +01:00)
View GitHub Profile
@keki
keki / gist:9261886
Created February 27, 2014 23:25
Scala.xml vs. Jsoup example
//Scala xml -- this is supposed to return a collection of the elements to be modified
(e \ "_").find { child =>
(child \\ "_")
.filter { c =>
!isMedia(c.label)
}
.exists { c =>
c.child.exists { c =>
(singleParagraphs && isMedia(c.label)) || (c.label == "#PCDATA" && isEmpty(c.text))
}
@keki
keki / EpidemyDisplay.scala
Created November 18, 2013 11:14
EpidemyDisplay.scala for Assignment #2 of the Principles of Reactive Programming course at Coursera This version displays dead people separately (in gray).
package simulations
package gui
import javax.swing.{JComponent, JFrame, JLabel, Timer, SwingUtilities}
import javax.swing.border.{EmptyBorder}
import java.awt.{Graphics, Graphics2D, GridLayout, BorderLayout, Color, Dimension, Rectangle, Polygon}
import java.awt.event.{ActionListener, ActionEvent}
object EpidemyDisplay extends EpidemySimulator with App {