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
const pgp = require('pg-promise')({ | |
connect: setStatementTimeoutOnFirstUse | |
}) | |
function setStatementTimeoutOnFirstUse(client, dc, useCount) { | |
if (useCount > 0) { | |
return | |
} | |
client.query("SET statement_timeout = '500ms';") | |
} |
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
327a328,335 | |
> #### /vessels/<RegExp>/environment/inside/engineRoom/temperature | |
> | |
> **Units:** K (Kelvin) | |
> | |
> **Description:** Temperature | |
> | |
> --- | |
> | |
333a342,349 |
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 scala.util.parsing.combinator._ | |
object ParserTest extends RegexParsers { | |
def text = """\"[^"]*\" ?""".r ^^ {x => DBString(x)} | |
def double = """[0-9]*\.[0-9]*""".r ^^ {x => DBDouble(x.toDouble)} | |
def int = ("""[0-9]+""".r) ^^ {x => DBInt(x.toInt)} | |
def boolean = """(?i)(true|false)""".r ^^ {x => DBBoolean(x.toLowerCase.equals("true"))} | |
def dbvalue = text | double | int | boolean | |
def constant = dbvalue ^^ {x => VConstant(x)} |
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
// game mechanics are exposed to the solver with this | |
public interface GameBridge { | |
public CellState getCell(int x, int y); | |
public int getBoardWidth(); | |
public int getBoardHeight(); | |
public int getMineCount(); | |
// returns the number of near mines for a cell | |
public int getMineCountForCell(int x, int y); | |
//shows a mine to the user |
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
# Authentication | |
def socks_authenticate | |
Socksify::debug_debug "Sending no authentication" | |
write "\005\001\000" | |
Socksify::debug_debug "Waiting for authentication reply" | |
auth_reply = recv(1) | |
if auth_reply[0] != 4 and auth_reply[0] != 5 | |
raise SOCKSError.new("SOCKS version #{auth_reply[0]} not supported") | |
end | |
auth_reply = recv(1) |