Skip to content

Instantly share code, notes, and snippets.

@tyrcho
tyrcho / README.md
Last active August 29, 2015 13:56 — forked from mbostock/.block

A basic HTML bar chart with log scale.

@tyrcho
tyrcho / index.html
Created May 21, 2014 09:02
A Pen by Michel Daviot.
<div class="contenzone">
<div class="titlebar">
<a href="aazeae">qsdqsd</a>
</div>
</div>
<div id="loggedout">
<a id="connectLink" href="#">Connect To Trello</a>
</div>
@tyrcho
tyrcho / pom.xml
Last active August 29, 2015 14:01
Hybrid project with java + scala sources
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>demo</groupId>
<artifactId>maven-scala-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>Hybrid project with java + scala sources</description>
<properties>
<scala.version>2.10.4</scala.version>
@tyrcho
tyrcho / Screenshots.scala
Last active August 29, 2015 14:02
mp4 video from screenshots in scala
import java.awt.GraphicsEnvironment
import java.awt.Rectangle
import java.awt.Robot
import java.awt.image.BufferedImage
import java.io.File
import java.nio.ByteBuffer
import java.util.ArrayList
import java.util.Arrays
import scala.Array.canBuildFrom
@tyrcho
tyrcho / Appart.md
Last active August 29, 2015 14:03
test.md
@tyrcho
tyrcho / longdoc.md
Created July 8, 2014 22:59
Welcome document

Welcome to StackEdit! {#welcome}

Hello, I am your first Markdown document within StackEdit[^stackedit]. Don't delete me, I can be helpful. I can be recovered anyway in the Utils tab of the Settings dialog.


Documents

@tyrcho
tyrcho / bl.ocks.org.md
Last active August 29, 2015 14:03
bl.ocks.org
@tyrcho
tyrcho / Gitter Travis integration.md
Created July 9, 2014 12:24
Gitter Travis integration.md

Gitter / Travis integration

In the [.travis.yml][1] file :

 webhooks:
    urls:
      - https://webhooks.gitter.im/e/3069b7e759e1d02548c1
    on_success: always  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always

on_start: false # default: false

@tyrcho
tyrcho / FrequencyTable.scala
Last active August 29, 2015 14:04
Computing frequency table in scala using breeze
import breeze.linalg._
import scala.collection.mutable.Map
object FrequencyTable extends App {
val lines = io.Source.fromFile("t:/frequency.csv").getLines.take(10000000).toList ++
(List("washington", "taxes", "treasury") map { w => s"test,$w,1" })
val docs = Map.empty[String, Int]
val words = Map.empty[String, Int]
var docCount = -1
var wordCount = -1
@tyrcho
tyrcho / README.md
Last active August 29, 2015 14:06 — forked from tyrcho/README.md
Implementation of Hearthstone mulligans with scala-js-fiddle.

Open with scala-js-fiddle for a demo

Implementation of Hearthstone mulligans with scala-js-fiddle.

Examples

  • There are 2 important cards in a deck, but you don't keep them in the mulligan phase (let's say 2 Doomguards in zoo). What is the probability to have at least one in hand at a given turn, if the player did not start the game ?
  • You think an opponent plays one Sylvanas. You started the game. What is the probability he has drawn it, assuming he does not keep it in the mulligans ?
  • You play 4 acceleration (Innervate, Wild Growth) cards. By mulliganing everything except those, what is the probability to have exactly one in starting hand ?