This file contains 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
private void readFrame( | |
byte[] buffer, int frameLength, int leftToRead, Ref<bool> continueReading, | |
Act<Try<Messages.Messages.FromServer>> callback | |
) { | |
Log.debug(string.Format( | |
"Entering #readFrame(frameLength={0}, leftToRead={1})", frameLength, leftToRead | |
)); | |
var stream = tcp.GetStream(); | |
stream.BeginRead(buffer, frameLength - leftToRead, leftToRead, ar => { | |
var bytesRead = stream.EndRead(ar); |
This file contains 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
#!/usr/bin/env ruby | |
$tracks = [] | |
class Track | |
attr_accessor :no, :hours, :minutes, :seconds, :performer, :song_name | |
def initialize(no, hours, minutes, seconds, title) | |
@no, @hours, @minutes, @seconds = no, hours, minutes, seconds | |
split_title = title.split("-", 2) |
This file contains 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
#!/usr/bin/env ruby | |
$tracks = [] | |
class Track | |
attr_accessor :no, :hours, :minutes, :seconds, :performer, :song_name | |
def initialize(no, hours, minutes, seconds, title) | |
@no, @hours, @minutes, @seconds = no, hours, minutes, seconds | |
split_title = title.split("-", 2) |
This file contains 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
def moveAttack[A <: MovableFighter]( | |
world: World, unit: A, | |
target: SearchRes[OwnedObj], strict: Boolean=true | |
)(implicit ev: A#Self =:= A): Result[A] = { | |
moveAndThen(world, unit, target.path, strict) { case (newWorld, movedUnit) => | |
movedUnit.attackWS(target.value, newWorld).right.map(_.map { | |
case (w, u) => (w, u) | |
}) | |
} | |
} |
This file contains 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 sbt.Keys._ | |
name := "TBS Game" | |
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" | |
resolvers += Resolver.sonatypeRepo("releases") | |
resolvers += Resolver.sonatypeRepo("snapshots") |
This file contains 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
package app.models.game.world | |
import java.util.UUID | |
import app.models.game._ | |
import app.models.game.world.buildings._ | |
import app.models.game.world.props.{ExtractionSpeed, AsteroidImpl, PropImpl} | |
import app.models.game.world.units._ | |
import utils.IdObj |
This file contains 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
object SafeFizzBuzz extends scalaz.effect.SafeApp { | |
import scalaz._ | |
import scalaz.effect._ | |
import scalaz.std.string._ | |
override def run(args: ImmutableArray[String]): IO[Unit] = { | |
def int2answer(i: Int) = | |
if (i % 3 == 0 && i % 5 == 0) Some("fizzbuzz") | |
else if (i % 3 == 0) Some("fizz") | |
else if (i % 5 == 0) Some("buzz") |
This file contains 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
response.ids.foldLeft( | |
Task.now(Vector.empty[ApiQuery.OrderResponse]) | |
) { (task, id) => | |
for { | |
responses <- task | |
response <- ApiQuery.Order(id).request(cfg.baseUri, cfg.websiteRetries) | |
} yield responses :+ response | |
} |
This file contains 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
------ laurynas-tretjakovas-try-2/stupid/src/main/scala/stupid/Card.scala ------ | |
index 6d19063..51a8095 100755 | |
@@ -3,11 +3,13 @@ package stupid | |
import stupid.rank.Rank | |
import stupid.suite.Suite | |
-case class Card(suite: Suite, rank: Rank) extends Ordered[Card] { | |
- override def compare(that: Card): Int = Ordering.by[Card, (Rank, Suite)] { c => (c.rank, c.suite) }.compare(this, that) | |
-} | |
+case class Card(suite: Suite, rank: Rank) |
This file contains 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
- name: link nebula44 server munin plugins | |
file: src={{ home }}/nebula-server/current/script/munin-plugins/{{ item.src }} | |
dest=/etc/munin/plugins/nebula44_{{ item.dest }} | |
state=link | |
with_items: "{{ | |
res = ['metal', 'energy', 'zetium', 'creds'] | |
kinds = ['rates', 'counts'] | |
[ | |
{ | |
'src': 'market_.rb', |